diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 31b02730dda..ee2c7666fd5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -66,6 +66,7 @@ "packages/google-cloud-talent": "5.0.1", "packages/google-cloud-texttospeech": "4.0.4", "packages/google-cloud-translate": "7.0.4", + "packages/google-cloud-video-livestream": "0.3.4", "packages/google-cloud-video-transcoder": "2.2.3", "packages/google-cloud-videointelligence": "4.1.1", "packages/google-cloud-websecurityscanner": "2.1.3", diff --git a/packages/google-cloud-video-livestream/.OwlBot.yaml b/packages/google-cloud-video-livestream/.OwlBot.yaml new file mode 100644 index 00000000000..50845e34846 --- /dev/null +++ b/packages/google-cloud-video-livestream/.OwlBot.yaml @@ -0,0 +1,20 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/video/livestream/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-video-livestream/$1 diff --git a/packages/google-cloud-video-livestream/.eslintignore b/packages/google-cloud-video-livestream/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-video-livestream/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-video-livestream/.eslintrc.json b/packages/google-cloud-video-livestream/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-video-livestream/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-video-livestream/.gitattributes b/packages/google-cloud-video-livestream/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-video-livestream/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-video-livestream/.gitignore b/packages/google-cloud-video-livestream/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-video-livestream/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-video-livestream/.jsdoc.js b/packages/google-cloud-video-livestream/.jsdoc.js new file mode 100644 index 00000000000..171deca004f --- /dev/null +++ b/packages/google-cloud-video-livestream/.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/livestream', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-video-livestream/.mocharc.js b/packages/google-cloud-video-livestream/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-video-livestream/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-video-livestream/.nycrc b/packages/google-cloud-video-livestream/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-video-livestream/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-video-livestream/.prettierignore b/packages/google-cloud-video-livestream/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-video-livestream/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-video-livestream/.prettierrc.js b/packages/google-cloud-video-livestream/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-video-livestream/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-video-livestream/.repo-metadata.json b/packages/google-cloud-video-livestream/.repo-metadata.json new file mode 100644 index 00000000000..24656279f54 --- /dev/null +++ b/packages/google-cloud-video-livestream/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "livestream", + "api_shortname": "livestream", + "name_pretty": "Live Stream API", + "product_documentation": "https://cloud.google.com/livestream/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/livestream/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "codeowner_team": "@googleapis/cloud-media-team", + "distribution_name": "@google-cloud/livestream", + "api_id": "livestream.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-video-livestream/CHANGELOG.md b/packages/google-cloud-video-livestream/CHANGELOG.md new file mode 100644 index 00000000000..6f07eaf16a9 --- /dev/null +++ b/packages/google-cloud-video-livestream/CHANGELOG.md @@ -0,0 +1,69 @@ +# Changelog + +## [0.3.4](https://github.com/googleapis/nodejs-video-live-stream/compare/v0.3.3...v0.3.4) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#82](https://github.com/googleapis/nodejs-video-live-stream/issues/82)) ([f032c54](https://github.com/googleapis/nodejs-video-live-stream/commit/f032c546a3e61f4064439ed2a452c5d3fbeae8e8)) +* Regenerated protos JS and TS definitions ([#86](https://github.com/googleapis/nodejs-video-live-stream/issues/86)) ([9942fd4](https://github.com/googleapis/nodejs-video-live-stream/commit/9942fd4f62d287df3e3d02d75f3eccb698edc62e)) + +## [0.3.3](https://github.com/googleapis/nodejs-video-live-stream/compare/v0.3.2...v0.3.3) (2022-09-14) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#65](https://github.com/googleapis/nodejs-video-live-stream/issues/65)) ([a612a49](https://github.com/googleapis/nodejs-video-live-stream/commit/a612a492a4d4016b913b97431a741c95a0cdd09d)) + +## [0.3.2](https://github.com/googleapis/nodejs-video-live-stream/compare/v0.3.1...v0.3.2) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#62](https://github.com/googleapis/nodejs-video-live-stream/issues/62)) ([293e4f7](https://github.com/googleapis/nodejs-video-live-stream/commit/293e4f737d59273d11b2fb53a5c953363a3a6f0c)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-video-live-stream/issues/1553)) ([#61](https://github.com/googleapis/nodejs-video-live-stream/issues/61)) ([02076df](https://github.com/googleapis/nodejs-video-live-stream/commit/02076dfd0649ebd504cbda86ac58a63fc9f2da5f)) + +## [0.3.1](https://github.com/googleapis/nodejs-video-live-stream/compare/v0.3.0...v0.3.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#50](https://github.com/googleapis/nodejs-video-live-stream/issues/50)) ([b816f7f](https://github.com/googleapis/nodejs-video-live-stream/commit/b816f7f2b9898e78c504d30a5d83ae5701174346)) +* change import long to require ([#51](https://github.com/googleapis/nodejs-video-live-stream/issues/51)) ([9bcb06a](https://github.com/googleapis/nodejs-video-live-stream/commit/9bcb06af177b5d49f3d731183e1ee077874fd0db)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-video-live-stream/issues/1546)) ([#53](https://github.com/googleapis/nodejs-video-live-stream/issues/53)) ([018602e](https://github.com/googleapis/nodejs-video-live-stream/commit/018602e7994dc37ba8b08df2547a3048ac0a493c)) + +## [0.3.0](https://github.com/googleapis/nodejs-video-live-stream/compare/v0.2.0...v0.3.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#45](https://github.com/googleapis/nodejs-video-live-stream/issues/45)) ([fc3c1b4](https://github.com/googleapis/nodejs-video-live-stream/commit/fc3c1b426407d6ff8b825483c0ab892e25a28d09)) + +## [0.2.0](https://github.com/googleapis/nodejs-video-live-stream/compare/v0.1.0...v0.2.0) (2022-06-03) + + +### ⚠ BREAKING CHANGES + +* upgrade library to stable (#35) +* update library to use Node 12 (#34) + +### Features + +* upgrade library to stable ([#35](https://github.com/googleapis/nodejs-video-live-stream/issues/35)) ([ab9935b](https://github.com/googleapis/nodejs-video-live-stream/commit/ab9935b560bda6a047dbfa64cc7357e5647c272e)) + + +### Build System + +* update library to use Node 12 ([#34](https://github.com/googleapis/nodejs-video-live-stream/issues/34)) ([ce13574](https://github.com/googleapis/nodejs-video-live-stream/commit/ce13574050cc1cf510275737cf351660a2495f6b)) + + +### Miscellaneous Chores + +* release as v0.2.0 ([#38](https://github.com/googleapis/nodejs-video-live-stream/issues/38)) ([f068c7b](https://github.com/googleapis/nodejs-video-live-stream/commit/f068c7bdee9b877b53230df7a64b1d4ea30da8a1)) + +## 0.1.0 (2022-02-11) + + +### Features + +* initial generation of video livestream library ([#4](https://github.com/googleapis/nodejs-video-live-stream/issues/4)) ([1e1e570](https://github.com/googleapis/nodejs-video-live-stream/commit/1e1e570cf9e8a11458c35b9e2b6b5ecde6a140a3)) diff --git a/packages/google-cloud-video-livestream/CODE_OF_CONDUCT.md b/packages/google-cloud-video-livestream/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-video-livestream/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-video-livestream/CONTRIBUTING.md b/packages/google-cloud-video-livestream/CONTRIBUTING.md new file mode 100644 index 00000000000..d55ec0e71fa --- /dev/null +++ b/packages/google-cloud-video-livestream/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 Live Stream 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=livestream.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-video-livestream/LICENSE b/packages/google-cloud-video-livestream/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-video-livestream/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-cloud-video-livestream/README.md b/packages/google-cloud-video-livestream/README.md new file mode 100644 index 00000000000..da6856f56ce --- /dev/null +++ b/packages/google-cloud-video-livestream/README.md @@ -0,0 +1,208 @@ +[//]: # "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 + +# [Live Stream API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/livestream.svg)](https://www.npmjs.org/package/@google-cloud/livestream) + + + + +livestream client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-livestream/CHANGELOG.md). + +* [Live Stream API Node.js Client API Reference][client-docs] +* [Live Stream API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-video-livestream](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-livestream) + +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 Live Stream 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/livestream +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ +// const parent = 'abc123' +/** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token to + * determine if there are more items left to be queried. + */ +// const pageSize = 1234 +/** + * The next_page_token value returned from a previous List request, if any. + */ +// const pageToken = 'abc123' +/** + * The filter to apply to list results. + */ +// const filter = 'abc123' +/** + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ +// const orderBy = 'abc123' + +// Imports the Livestream library +const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + +// Instantiates a client +const livestreamClient = new LivestreamServiceClient(); + +async function callListChannels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listChannelsAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListChannels(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Livestream_service.create_channel | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js,samples/README.md) | +| Livestream_service.create_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js,samples/README.md) | +| Livestream_service.create_input | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js,samples/README.md) | +| Livestream_service.delete_channel | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js,samples/README.md) | +| Livestream_service.delete_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js,samples/README.md) | +| Livestream_service.delete_input | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js,samples/README.md) | +| Livestream_service.get_channel | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js,samples/README.md) | +| Livestream_service.get_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js,samples/README.md) | +| Livestream_service.get_input | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js,samples/README.md) | +| Livestream_service.list_channels | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js,samples/README.md) | +| Livestream_service.list_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js,samples/README.md) | +| Livestream_service.list_inputs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js,samples/README.md) | +| Livestream_service.start_channel | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js,samples/README.md) | +| Livestream_service.stop_channel | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js,samples/README.md) | +| Livestream_service.update_channel | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js,samples/README.md) | +| Livestream_service.update_input | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/test/quickstart.js,samples/README.md) | + + + +The [Live Stream 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/livestream@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/livestream/latest +[product-docs]: https://cloud.google.com/livestream/ +[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=livestream.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-video-livestream/linkinator.config.json b/packages/google-cloud-video-livestream/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-video-livestream/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-video-livestream/package.json b/packages/google-cloud-video-livestream/package.json new file mode 100644 index 00000000000..40f585ce099 --- /dev/null +++ b/packages/google-cloud-video-livestream/package.json @@ -0,0 +1,71 @@ +{ + "name": "@google-cloud/livestream", + "version": "0.3.4", + "description": "livestream client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-video-livestream", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google livestream", + "livestream", + "livestream service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm install", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.67.0", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-livestream" +} diff --git a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto new file mode 100644 index 00000000000..90ab85b4f7c --- /dev/null +++ b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/outputs.proto @@ -0,0 +1,397 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.video.livestream.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/video/livestream/v1;livestream"; +option java_multiple_files = true; +option java_outer_classname = "OutputsProto"; +option java_package = "com.google.cloud.video.livestream.v1"; +option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; +option ruby_package = "Google::Cloud::Video::LiveStream::V1"; + +// Encoding of an input element such as an audio, video, or text track. +// Elementary streams must be packaged before mapping and sharing between +// different output formats. +message ElementaryStream { + // A unique key for this elementary stream. + string key = 4; + + // Required. Encoding of an audio, video, or text track. + oneof elementary_stream { + // Encoding of a video stream. + VideoStream video_stream = 1; + + // Encoding of an audio stream. + AudioStream audio_stream = 2; + + // Encoding of a text stream. For example, closed captions or subtitles. + TextStream text_stream = 3; + } +} + +// Multiplexing settings for output stream. +message MuxStream { + // A unique key for this multiplexed stream. + string key = 1; + + // The container format. The default is `fmp4`. + // + // Supported container formats: + // + // - `fmp4` - the corresponding file extension is `.m4s` + // - `ts` - the corresponding file extension is `.ts` + string container = 3; + + // List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this + // stream. + // + // - For `fmp4` container, must contain either one video or one audio stream. + // - For `ts` container, must contain exactly one audio stream and up to one + // video stream. + repeated string elementary_streams = 4; + + // Segment settings for `fmp4` and `ts`. + SegmentSettings segment_settings = 5; +} + +// Manifest configuration. +message Manifest { + // The manifest type can be either `HLS` or `DASH`. + enum ManifestType { + // The manifest type is not specified. + MANIFEST_TYPE_UNSPECIFIED = 0; + + // Create an `HLS` manifest. The corresponding file extension is `.m3u8`. + HLS = 1; + + // Create a `DASH` manifest. The corresponding file extension is `.mpd`. + DASH = 2; + } + + // The name of the generated file. The default is `manifest` with the + // extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple + // manifests are added to the channel, each must have a unique file name. + string file_name = 1; + + // Required. Type of the manifest, can be `HLS` or `DASH`. + ManifestType type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this + // manifest. + // + // - For HLS, either `fmp4` or `ts` mux streams can be specified but not + // mixed. + // - For DASH, only `fmp4` mux streams can be specified. + repeated string mux_streams = 3 [(google.api.field_behavior) = REQUIRED]; + + // Maximum number of segments that this manifest holds. Once the manifest + // reaches this maximum number of segments, whenever a new segment is added to + // the manifest, the oldest segment will be removed from the manifest. + // The minimum value is 3 and the default value is 5. + int32 max_segment_count = 4; + + // How long to keep a segment on the output Google Cloud Storage bucket after + // it is removed from the manifest. This field should be large enough to cover + // the manifest propagation delay. Otherwise, a player could receive 404 + // errors while accessing segments which are listed in the manifest that the + // player has, but were already deleted from the output Google Cloud Storage + // bucket. Default value is `60s`. + google.protobuf.Duration segment_keep_duration = 5; +} + +// Sprite sheet configuration. +message SpriteSheet { + // Format type. The default is `jpeg`. + // + // Supported formats: + // + // - `jpeg` + string format = 1; + + // Required. File name prefix for the generated sprite sheets. If multiple + // sprite sheets are added to the channel, each must have a unique file + // prefix. + // Each sprite sheet has an incremental 10-digit zero-padded suffix starting + // from 0 before the extension, such as `sprite_sheet0000000123.jpeg`. + string file_prefix = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The width of the sprite in pixels. Must be an even integer. + int32 sprite_width_pixels = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The height of the sprite in pixels. Must be an even integer. + int32 sprite_height_pixels = 4 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of sprites per row in a sprite sheet. Valid range is + // [1, 10] and the default value is 1. + int32 column_count = 5; + + // The maximum number of rows per sprite sheet. When the sprite sheet is full, + // a new sprite sheet is created. Valid range is [1, 10] and the default value + // is 1. + int32 row_count = 6; + + // Create sprites at regular intervals. Valid range is [1 second, 1 hour] and + // the default value is `10s`. + google.protobuf.Duration interval = 7; + + // The quality of the generated sprite sheet. Enter a value between 1 + // and 100, where 1 is the lowest quality and 100 is the highest quality. + // The default is 100. A high quality value corresponds to a low image data + // compression ratio. + int32 quality = 8; +} + +// Preprocessing configurations. +message PreprocessingConfig { + // Video cropping configuration for the input video. The cropped input video + // is scaled to match the output resolution. + message Crop { + // The number of pixels to crop from the top. The default is 0. + int32 top_pixels = 1; + + // The number of pixels to crop from the bottom. The default is 0. + int32 bottom_pixels = 2; + + // The number of pixels to crop from the left. The default is 0. + int32 left_pixels = 3; + + // The number of pixels to crop from the right. The default is 0. + int32 right_pixels = 4; + } + + // Pad filter configuration for the input video. The padded input video + // is scaled after padding with black to match the output resolution. + message Pad { + // The number of pixels to add to the top. The default is 0. + int32 top_pixels = 1; + + // The number of pixels to add to the bottom. The default is 0. + int32 bottom_pixels = 2; + + // The number of pixels to add to the left. The default is 0. + int32 left_pixels = 3; + + // The number of pixels to add to the right. The default is 0. + int32 right_pixels = 4; + } + + // Specify the video cropping configuration. + Crop crop = 2; + + // Specify the video pad filter configuration. + Pad pad = 3; +} + +// Video stream resource. +message VideoStream { + // H264 codec settings. + message H264CodecSettings { + // Required. The width of the video in pixels. Must be an even integer. + // Valid range is [320, 1920]. + int32 width_pixels = 1; + + // Required. The height of the video in pixels. Must be an even integer. + // Valid range is [180, 1080]. + int32 height_pixels = 2; + + // Required. The target video frame rate in frames per second (FPS). Must be less + // than or equal to 60. Will default to the input frame rate if larger + // than the input frame rate. The API will generate an output FPS that is + // divisible by the input FPS, and smaller or equal to the target FPS. See + // [Calculating frame + // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for + // more information. + double frame_rate = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The video bitrate in bits per second. Minimum value is 10,000. + // + // - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). + // - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). + int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED]; + + // Specifies whether an open Group of Pictures (GOP) structure should be + // allowed or not. The default is `false`. + bool allow_open_gop = 6; + + // GOP mode can be either by frame count or duration. + oneof gop_mode { + // Select the GOP size based on the specified frame count. + // If GOP frame count is set instead of GOP duration, GOP duration will be + // calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration + // must satisfy the limitations on `gopDuration` as well. + // Valid range is [60, 600]. + int32 gop_frame_count = 7; + + // Select the GOP size based on the specified duration. The default is + // `2s`. Note that `gopDuration` must be less than or equal to + // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], and + // [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] must be divisible + // by `gopDuration`. Valid range is [2s, 20s]. + // + // All video streams in the same channel must have the same GOP size. + google.protobuf.Duration gop_duration = 8; + } + + // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be + // greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps]. + int32 vbv_size_bits = 9; + + // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. + // Must be greater than zero. The default is equal to 90% of + // [vbv_size_bits][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits]. + int32 vbv_fullness_bits = 10; + + // The entropy coder to use. The default is `cabac`. + // + // Supported entropy coders: + // + // - `cavlc` + // - `cabac` + string entropy_coder = 11; + + // Allow B-pyramid for reference frame selection. This may not be supported + // on all decoders. The default is `false`. + bool b_pyramid = 12; + + // The number of consecutive B-frames. Must be greater than or equal to + // zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default + // is 0. + int32 b_frame_count = 13; + + // Specify the intensity of the adaptive quantizer (AQ). Must be between 0 + // and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A + // higher value equals a lower bitrate but smoother image. The default is 0. + double aq_strength = 14; + + // Enforces the specified codec profile. The following profiles are + // supported: + // + // * `baseline` + // * `main` (default) + // * `high` + // + // The available options are [FFmpeg-compatible Profile + // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] + // message. + string profile = 15; + + // Enforces the specified codec tune. The available options are + // [FFmpeg-compatible Encode + // Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) + // Note that certain values for this field may cause the transcoder to + // override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message. + string tune = 16; + } + + // Codec settings. + oneof codec_settings { + // H264 codec settings. + H264CodecSettings h264 = 20; + } +} + +// Audio stream resource. +message AudioStream { + // The mapping for the input streams and audio channels. + message AudioMapping { + // Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this + // audio mapping applies to. If an active input doesn't have an audio + // mapping, the primary audio track in the input stream will be selected. + string input_key = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the track in the input stream. + // All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] + // must have the same input track. + int32 input_track = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the channel in the input stream. + int32 input_channel = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the channel in the output audio stream. + // Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel]. + int32 output_channel = 4 [(google.api.field_behavior) = REQUIRED]; + } + + // Specifies whether pass through (transmuxing) is enabled or not. + // If set to `true`, the rest of the settings, other than `mapping`, will be + // ignored. The default is `false`. + bool transmux = 8; + + // The codec for this audio stream. The default is `aac`. + // + // Supported audio codecs: + // + // - `aac` + string codec = 1; + + // Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. + int32 bitrate_bps = 2 [(google.api.field_behavior) = REQUIRED]; + + // Number of audio channels. Must be between 1 and 6. The default is 2. + int32 channel_count = 3; + + // A list of channel names specifying layout of the audio channels. + // This only affects the metadata embedded in the container headers, if + // supported by the specified format. The default is `[fl, fr]`. + // + // Supported channel names: + // + // - `fl` - Front left channel + // - `fr` - Front right channel + // - `sl` - Side left channel + // - `sr` - Side right channel + // - `fc` - Front center channel + // - `lfe` - Low frequency + repeated string channel_layout = 4; + + // The mapping for the input streams and audio channels. + repeated AudioMapping mapping = 5; + + // The audio sample rate in Hertz. The default is 48000 Hertz. + int32 sample_rate_hertz = 6; +} + +// Encoding of a text stream. For example, closed captions or subtitles. +message TextStream { + // Required. The codec for this text stream. + // + // Supported text codecs: + // + // - `cea608` + // - `cea708` + string codec = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Segment settings for `fmp4` and `ts`. +message SegmentSettings { + // Duration of the segments in seconds. The default is `6s`. Note that + // `segmentDuration` must be greater than or equal to + // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and + // `segmentDuration` must be divisible by + // [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration]. + // Valid range is [2s, 20s]. + // + // All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the + // same segment duration. + google.protobuf.Duration segment_duration = 1; +} diff --git a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto new file mode 100644 index 00000000000..b9159ec9744 --- /dev/null +++ b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/resources.proto @@ -0,0 +1,408 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.video.livestream.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/video/livestream/v1/outputs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/video/livestream/v1;livestream"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.video.livestream.v1"; +option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; +option ruby_package = "Google::Cloud::Video::LiveStream::V1"; + +// Input resource represents the endpoint from which the channel ingests +// the input stream. +message Input { + option (google.api.resource) = { + type: "livestream.googleapis.com/Input" + pattern: "projects/{project}/locations/{location}/inputs/{input}" + }; + + // The type of the input. + enum Type { + // Input type is not specified. + TYPE_UNSPECIFIED = 0; + + // Input will take an rtmp input stream. + RTMP_PUSH = 1; + + // Input will take an srt (Secure Reliable Transport) input stream. + SRT_PUSH = 2; + } + + // Tier of the input specification. + enum Tier { + // Tier is not specified. + TIER_UNSPECIFIED = 0; + + // Resolution < 1280x720. Bitrate <= 6 Mbps. FPS <= 60. + SD = 1; + + // Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. + HD = 2; + + // Resolution <= 4096x2160. Not supported yet. + UHD = 3; + } + + // Security rules for access control. Each field represents one security rule. + // Only when the source of the input stream satisfies all the fields, this + // input stream can be accepted. + message SecurityRule { + // At least one ip range must match unless none specified. The IP range is + // defined by CIDR block: for example, `192.0.1.0/24` for a range and + // `192.0.1.0/32` for a single IP address. + repeated string ip_ranges = 1; + } + + // The resource name of the input, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-defined key/value metadata. + map labels = 4; + + // Source type. + Type type = 5; + + // Tier defines the maximum input specification that is accepted by the + // video pipeline. The billing is charged based on the tier specified here. + // See [Pricing](https://cloud.google.com/livestream/pricing) for more detail. + // The default is `HD`. + Tier tier = 14; + + // Output only. URI to push the input stream to. + // Its format depends on the input [type][google.cloud.video.livestream.v1.Input.type], for example: + // + // * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` + // * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` + string uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Preprocessing configurations. + PreprocessingConfig preprocessing_config = 9; + + // Security rule for access control. + SecurityRule security_rules = 12; + + // Output only. The information for the input stream. This field will be present only when + // this input receives the input stream. + InputStreamProperty input_stream_property = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Channel resource represents the processor that does a user-defined +// "streaming" operation, which includes getting an input stream through an +// input, transcoding it to multiple renditions, and publishing output live +// streams in certain formats (for example, HLS or DASH) to the specified +// location. +message Channel { + option (google.api.resource) = { + type: "livestream.googleapis.com/Channel" + pattern: "projects/{project}/locations/{location}/channels/{channel}" + }; + + // Location of output file(s) in a Google Cloud Storage bucket. + message Output { + // URI for the output file(s). For example, `gs://my-bucket/outputs/`. + string uri = 1; + } + + // State of streaming operation that the channel is running. + enum StreamingState { + // Streaming state is not specified. + STREAMING_STATE_UNSPECIFIED = 0; + + // Channel is getting the input stream, generating the live streams to the + // specified output location. + STREAMING = 1; + + // Channel is waiting for the input stream through the input. + AWAITING_INPUT = 2; + + // Channel is running, but has trouble publishing the live streams onto the + // specified output location (for example, the specified Cloud Storage + // bucket is not writable). + STREAMING_ERROR = 4; + + // Channel is generating live streams with no input stream. Live streams are + // filled out with black screen, while input stream is missing. + // Not supported yet. + STREAMING_NO_INPUT = 5; + + // Channel is stopped, finishing live streams. + STOPPED = 6; + + // Channel is starting. + STARTING = 7; + + // Channel is stopping. + STOPPING = 8; + } + + // The resource name of the channel, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-defined key/value metadata. + map labels = 4; + + // A list of input attachments that this channel uses. + // One channel can have multiple inputs as the input sources. Only one + // input can be selected as the input source at one time. + repeated InputAttachment input_attachments = 16; + + // Output only. The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that serves as the current input source. The + // first input in the [input_attachments][google.cloud.video.livestream.v1.Channel.input_attachments] is the initial input source. + string active_input = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Information about the output (that is, the Cloud Storage bucket to store + // the generated live stream). + Output output = 9 [(google.api.field_behavior) = REQUIRED]; + + // List of elementary streams. + repeated ElementaryStream elementary_streams = 10; + + // List of multiplexing settings for output streams. + repeated MuxStream mux_streams = 11; + + // List of output manifests. + repeated Manifest manifests = 12; + + // List of output sprite sheets. + repeated SpriteSheet sprite_sheets = 13; + + // Output only. State of the streaming operation. + StreamingState streaming_state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A description of the reason for the streaming error. This property is + // always present when [streaming_state][google.cloud.video.livestream.v1.Channel.streaming_state] is + // [STREAMING_ERROR][google.cloud.video.livestream.v1.Channel.StreamingState.STREAMING_ERROR]. + google.rpc.Status streaming_error = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration of platform logs for this channel. + LogConfig log_config = 19; +} + +// Configuration of platform logs. +// See [Using and managing platform +// logs](https://cloud.google.com/logging/docs/api/platform-logs#managing-logs) +// for more information about how to view platform logs through Cloud Logging. +message LogConfig { + // The severity level of platform logging for this channel. Logs with a + // severity level higher than or equal to the chosen severity level will be + // logged and can be viewed through Cloud Logging. + // The severity level of a log is ranked as followed from low to high: DEBUG < + // INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY. + // See + // [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) + // for more information. + enum LogSeverity { + // Log severity is not specified. This is the same as log severity is OFF. + LOG_SEVERITY_UNSPECIFIED = 0; + + // Log is turned off. + OFF = 1; + + // Log with severity higher than or equal to DEBUG are logged. + DEBUG = 100; + + // Logs with severity higher than or equal to INFO are logged. + INFO = 200; + + // Logs with severity higher than or equal to WARNING are logged. + WARNING = 400; + + // Logs with severity higher than or equal to ERROR are logged. + ERROR = 500; + } + + // The severity level of platform logging for this resource. + LogSeverity log_severity = 1; +} + +// Properties of the input stream. +message InputStreamProperty { + // The time that the current input stream is accepted and the connection is + // established. + google.protobuf.Timestamp last_establish_time = 1; + + // Properties of the video streams. + repeated VideoStreamProperty video_streams = 2; + + // Properties of the audio streams. + repeated AudioStreamProperty audio_streams = 3; +} + +// Properties of the video stream. +message VideoStreamProperty { + // Index of this video stream. + int32 index = 1; + + // Properties of the video format. + VideoFormat video_format = 2; +} + +// Properties of the video format. +message VideoFormat { + // Video codec used in this video stream. + string codec = 1; + + // The width of the video stream in pixels. + int32 width_pixels = 2; + + // The height of the video stream in pixels. + int32 height_pixels = 3; + + // The frame rate of the input video stream. + double frame_rate = 4; +} + +// Properties of the audio stream. +message AudioStreamProperty { + // Index of this audio stream. + int32 index = 1; + + // Properties of the audio format. + AudioFormat audio_format = 2; +} + +// Properties of the audio format. +message AudioFormat { + // Audio codec used in this audio stream. + string codec = 1; + + // The number of audio channels. + int32 channel_count = 2; + + // A list of channel names specifying the layout of the audio channels. + repeated string channel_layout = 3; +} + +// A group of information for attaching an input resource to this channel. +message InputAttachment { + // Configurations to follow when automatic failover happens. + message AutomaticFailover { + // The [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]s of inputs to failover to when this input is + // disconnected. Currently, only up to one backup input is supported. + repeated string input_keys = 1; + } + + // A unique key for this input attachment. + string key = 1; + + // The resource name of an existing input, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string input = 2 [(google.api.resource_reference) = { + type: "livestream.googleapis.com/Input" + }]; + + // Automatic failover configurations. + AutomaticFailover automatic_failover = 3; +} + +// Event is a sub-resource of a channel, which can be scheduled by the user to +// execute operations on a channel resource without having to stop the channel. +message Event { + option (google.api.resource) = { + type: "livestream.googleapis.com/Event" + pattern: "projects/{project}/locations/{location}/channels/{channel}/events/{event}" + }; + + // Inserts a new ad opportunity. + message AdBreakTask { + // Duration of an ad opportunity. Must be greater than 0. + google.protobuf.Duration duration = 1; + } + + // State of the event + enum State { + // Event state is not specified. + STATE_UNSPECIFIED = 0; + + // Event is scheduled but not executed yet. + SCHEDULED = 1; + + // Event is being executed. + RUNNING = 2; + + // Event has been successfully executed. + SUCCEEDED = 3; + + // Event fails to be executed. + FAILED = 4; + + // Event has been created but not scheduled yet. + PENDING = 5; + + // Event was stopped before running for its full duration. + STOPPED = 6; + } + + // The resource name of the event, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-defined key/value metadata. + map labels = 4; + + // Required. Operation to be executed by this event. + oneof task { + // Required. Inserts a new ad opportunity. + AdBreakTask ad_break = 6 [(google.api.field_behavior) = REQUIRED]; + } + + // When this field is set to true, the event will be executed at the earliest + // time that the server can schedule the event and [execution_time][google.cloud.video.livestream.v1.Event.execution_time] will be + // populated with the time that the server actually schedules the event. + bool execute_now = 9; + + // The time when the event should be executed. When [execute_now][google.cloud.video.livestream.v1.Event.execute_now] is set to + // `true`, this field should not be set in `CreateEvent` request and will be + // populated with the time that the server schedules the event. + google.protobuf.Timestamp execution_time = 10; + + // Output only. The state of the event. + State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An error object that describes the reason for the failure. + // This property is always present when `state` is `FAILED`. + google.rpc.Status error = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto new file mode 100644 index 00000000000..8ef65d80814 --- /dev/null +++ b/packages/google-cloud-video-livestream/protos/google/cloud/video/livestream/v1/service.proto @@ -0,0 +1,719 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.video.livestream.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/video/livestream/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Video.LiveStream.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/video/livestream/v1;livestream"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.video.livestream.v1"; +option php_namespace = "Google\\Cloud\\Video\\LiveStream\\V1"; +option ruby_package = "Google::Cloud::Video::LiveStream::V1"; + +// Using Live Stream API, you can generate live streams in the various +// renditions and streaming formats. The streaming format include HTTP Live +// Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send +// a source stream in the various ways, including Real-Time Messaging +// Protocol (RTMP) and Secure Reliable Transport (SRT). +service LivestreamService { + option (google.api.default_host) = "livestream.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a channel with the provided unique ID in the specified + // region. + rpc CreateChannel(CreateChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/channels" + body: "channel" + }; + option (google.api.method_signature) = "parent,channel,channel_id"; + option (google.longrunning.operation_info) = { + response_type: "Channel" + metadata_type: "OperationMetadata" + }; + } + + // Returns a list of all channels in the specified region. + rpc ListChannels(ListChannelsRequest) returns (ListChannelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/channels" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified channel. + rpc GetChannel(GetChannelRequest) returns (Channel) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/channels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified channel. + rpc DeleteChannel(DeleteChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/channels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates the specified channel. + rpc UpdateChannel(UpdateChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{channel.name=projects/*/locations/*/channels/*}" + body: "channel" + }; + option (google.api.method_signature) = "channel,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Channel" + metadata_type: "OperationMetadata" + }; + } + + // Starts the specified channel. Part of the video pipeline will be created + // only when the StartChannel request is received by the server. + rpc StartChannel(StartChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/channels/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ChannelOperationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Stops the specified channel. Part of the video pipeline will be released + // when the StopChannel request is received by the server. + rpc StopChannel(StopChannelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/channels/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ChannelOperationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Creates an input with the provided unique ID in the specified region. + rpc CreateInput(CreateInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/inputs" + body: "input" + }; + option (google.api.method_signature) = "parent,input,input_id"; + option (google.longrunning.operation_info) = { + response_type: "Input" + metadata_type: "OperationMetadata" + }; + } + + // Returns a list of all inputs in the specified region. + rpc ListInputs(ListInputsRequest) returns (ListInputsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/inputs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified input. + rpc GetInput(GetInputRequest) returns (Input) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/inputs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified input. + rpc DeleteInput(DeleteInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/inputs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates the specified input. + rpc UpdateInput(UpdateInputRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{input.name=projects/*/locations/*/inputs/*}" + body: "input" + }; + option (google.api.method_signature) = "input,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Input" + metadata_type: "OperationMetadata" + }; + } + + // Creates an event with the provided unique ID in the specified channel. + rpc CreateEvent(CreateEventRequest) returns (Event) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/channels/*}/events" + body: "event" + }; + option (google.api.method_signature) = "parent,event,event_id"; + } + + // Returns a list of all events in the specified channel. + rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/channels/*}/events" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the specified event. + rpc GetEvent(GetEventRequest) returns (Event) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/channels/*/events/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the specified event. + rpc DeleteEvent(DeleteEventRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/channels/*/events/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for "LivestreamService.CreateChannel". +message CreateChannelRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Channel" + } + ]; + + // Required. The channel resource to be created. + Channel channel = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the channel resource to be created. + // This value must be 1-63 characters, begin and end with `[a-z0-9]`, + // could contain dashes (-) in between. + string channel_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for "LivestreamService.ListChannels". +message ListChannelsRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Channel" + } + ]; + + // The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token] to + // determine if there are more items left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // The filter to apply to list results. + string filter = 4; + + // Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for "LivestreamService.ListChannels". +message ListChannelsResponse { + // A list of channels. + repeated Channel channels = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for "LivestreamService.GetChannel". +message GetChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; +} + +// Request message for "LivestreamService.DeleteChannel". +message DeleteChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; + + // If the `force` field is set to the default value of `false`, you must + // delete all of a channel's events before you can delete the channel itself. + // If the field is set to `true`, requests to delete a channel also delete + // associated channel events. + bool force = 3; +} + +// Request message for "LivestreamService.UpdateChannel". +message UpdateChannelRequest { + // Field mask is used to specify the fields to be overwritten in the Channel + // resource by the update. You can only update the following fields: + // + // * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + // * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + // * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + // * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + // * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) + // * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + // + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. + google.protobuf.FieldMask update_mask = 1; + + // Required. The channel resource to be updated. + Channel channel = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 3; +} + +// Request message for "LivestreamService.StartChannel". +message StartChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Request message for "LivestreamService.StopChannel". +message StopChannelRequest { + // Required. The name of the channel resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Channel" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Request message for "LivestreamService.CreateInput". +message CreateInputRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Input" + } + ]; + + // Required. The input resource to be created. + Input input = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the input resource to be created. + // This value must be 1-63 characters, begin and end with `[a-z0-9]`, + // could contain dashes (-) in between. + string input_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for "LivestreamService.ListInputs". +message ListInputsRequest { + // Required. The parent location for the resource, in the form of: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Input" + } + ]; + + // The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.video.livestream.v1.ListInputsResponse.next_page_token] to + // determine if there are more items left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // The filter to apply to list results. + string filter = 4; + + // Specifies the ordering of results following syntax at [Sorting + // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + string order_by = 5; +} + +// Response message for "LivestreamService.ListInputs". +message ListInputsResponse { + // A list of inputs. + repeated Input inputs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for "LivestreamService.GetInput". +message GetInputRequest { + // Required. The name of the input resource, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Input" + } + ]; +} + +// Request message for "LivestreamService.DeleteInput". +message DeleteInputRequest { + // Required. The name of the input resource, in the form of: + // `projects/{project}/locations/{location}/inputs/{inputId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Input" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Request message for "LivestreamService.UpdateInput". +message UpdateInputRequest { + // Field mask is used to specify the fields to be overwritten in the Input + // resource by the update. You can only update the following fields: + // + // * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + // * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + // + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. + google.protobuf.FieldMask update_mask = 1; + + // Required. The input resource to be updated. + Input input = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 3; +} + +// Request message for "LivestreamService.CreateEvent". +message CreateEventRequest { + // Required. The parent channel for the resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Event" + } + ]; + + // Required. The event resource to be created. + Event event = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the event resource to be created. + // This value must be 1-63 characters, begin and end with `[a-z0-9]`, + // could contain dashes (-) in between. + string event_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 4; +} + +// Request message for "LivestreamService.ListEvents". +message ListEventsRequest { + // Required. The parent channel for the resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "livestream.googleapis.com/Event" + } + ]; + + // The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.video.livestream.v1.ListEventsResponse.next_page_token] to + // determine if there are more items left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // The filter to apply to list results. + string filter = 4; + + // Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5; +} + +// Response message for "LivestreamService.ListEvents". +message ListEventsResponse { + // A list of events. + repeated Event events = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for "LivestreamService.GetEvent". +message GetEventRequest { + // Required. The name of the event resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Event" + } + ]; +} + +// Request message for "LivestreamService.DeleteEvent". +message DeleteEventRequest { + // Required. The name of the event resource, in the form of: + // `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "livestream.googleapis.com/Event" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request ID, + // the server can check if original operation with the same request ID was + // received, and if so, will ignore the second request. This prevents clients + // from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported `(00000000-0000-0000-0000-000000000000)`. + string request_id = 2; +} + +// Response message for Start/Stop Channel long-running operations. +message ChannelOperationResponse { + +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-video-livestream/protos/protos.d.ts b/packages/google-cloud-video-livestream/protos/protos.d.ts new file mode 100644 index 00000000000..ead893d7f21 --- /dev/null +++ b/packages/google-cloud-video-livestream/protos/protos.d.ts @@ -0,0 +1,11479 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace video. */ + namespace video { + + /** Namespace livestream. */ + namespace livestream { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an ElementaryStream. */ + interface IElementaryStream { + + /** ElementaryStream key */ + key?: (string|null); + + /** ElementaryStream videoStream */ + videoStream?: (google.cloud.video.livestream.v1.IVideoStream|null); + + /** ElementaryStream audioStream */ + audioStream?: (google.cloud.video.livestream.v1.IAudioStream|null); + + /** ElementaryStream textStream */ + textStream?: (google.cloud.video.livestream.v1.ITextStream|null); + } + + /** Represents an ElementaryStream. */ + class ElementaryStream implements IElementaryStream { + + /** + * Constructs a new ElementaryStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IElementaryStream); + + /** ElementaryStream key. */ + public key: string; + + /** ElementaryStream videoStream. */ + public videoStream?: (google.cloud.video.livestream.v1.IVideoStream|null); + + /** ElementaryStream audioStream. */ + public audioStream?: (google.cloud.video.livestream.v1.IAudioStream|null); + + /** ElementaryStream textStream. */ + public textStream?: (google.cloud.video.livestream.v1.ITextStream|null); + + /** ElementaryStream elementaryStream. */ + public elementaryStream?: ("videoStream"|"audioStream"|"textStream"); + + /** + * Creates a new ElementaryStream instance using the specified properties. + * @param [properties] Properties to set + * @returns ElementaryStream instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IElementaryStream): google.cloud.video.livestream.v1.ElementaryStream; + + /** + * Encodes the specified ElementaryStream message. Does not implicitly {@link google.cloud.video.livestream.v1.ElementaryStream.verify|verify} messages. + * @param message ElementaryStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IElementaryStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ElementaryStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ElementaryStream.verify|verify} messages. + * @param message ElementaryStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IElementaryStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ElementaryStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ElementaryStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ElementaryStream; + + /** + * Decodes an ElementaryStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ElementaryStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ElementaryStream; + + /** + * Verifies an ElementaryStream message. + * @param message Plain 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 ElementaryStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ElementaryStream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ElementaryStream; + + /** + * Creates a plain object from an ElementaryStream message. Also converts values to other types if specified. + * @param message ElementaryStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ElementaryStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ElementaryStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ElementaryStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MuxStream. */ + interface IMuxStream { + + /** MuxStream key */ + key?: (string|null); + + /** MuxStream container */ + container?: (string|null); + + /** MuxStream elementaryStreams */ + elementaryStreams?: (string[]|null); + + /** MuxStream segmentSettings */ + segmentSettings?: (google.cloud.video.livestream.v1.ISegmentSettings|null); + } + + /** Represents a MuxStream. */ + class MuxStream implements IMuxStream { + + /** + * Constructs a new MuxStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IMuxStream); + + /** MuxStream key. */ + public key: string; + + /** MuxStream container. */ + public container: string; + + /** MuxStream elementaryStreams. */ + public elementaryStreams: string[]; + + /** MuxStream segmentSettings. */ + public segmentSettings?: (google.cloud.video.livestream.v1.ISegmentSettings|null); + + /** + * Creates a new MuxStream instance using the specified properties. + * @param [properties] Properties to set + * @returns MuxStream instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IMuxStream): google.cloud.video.livestream.v1.MuxStream; + + /** + * Encodes the specified MuxStream message. Does not implicitly {@link google.cloud.video.livestream.v1.MuxStream.verify|verify} messages. + * @param message MuxStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IMuxStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuxStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.MuxStream.verify|verify} messages. + * @param message MuxStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IMuxStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MuxStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MuxStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.MuxStream; + + /** + * Decodes a MuxStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MuxStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.MuxStream; + + /** + * Verifies a MuxStream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MuxStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MuxStream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.MuxStream; + + /** + * Creates a plain object from a MuxStream message. Also converts values to other types if specified. + * @param message MuxStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.MuxStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MuxStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MuxStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Manifest. */ + interface IManifest { + + /** Manifest fileName */ + fileName?: (string|null); + + /** Manifest type */ + type?: (google.cloud.video.livestream.v1.Manifest.ManifestType|keyof typeof google.cloud.video.livestream.v1.Manifest.ManifestType|null); + + /** Manifest muxStreams */ + muxStreams?: (string[]|null); + + /** Manifest maxSegmentCount */ + maxSegmentCount?: (number|null); + + /** Manifest segmentKeepDuration */ + segmentKeepDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a Manifest. */ + class Manifest implements IManifest { + + /** + * Constructs a new Manifest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IManifest); + + /** Manifest fileName. */ + public fileName: string; + + /** Manifest type. */ + public type: (google.cloud.video.livestream.v1.Manifest.ManifestType|keyof typeof google.cloud.video.livestream.v1.Manifest.ManifestType); + + /** Manifest muxStreams. */ + public muxStreams: string[]; + + /** Manifest maxSegmentCount. */ + public maxSegmentCount: number; + + /** Manifest segmentKeepDuration. */ + public segmentKeepDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new Manifest instance using the specified properties. + * @param [properties] Properties to set + * @returns Manifest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IManifest): google.cloud.video.livestream.v1.Manifest; + + /** + * Encodes the specified Manifest message. Does not implicitly {@link google.cloud.video.livestream.v1.Manifest.verify|verify} messages. + * @param message Manifest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Manifest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Manifest.verify|verify} messages. + * @param message Manifest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Manifest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Manifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Manifest; + + /** + * Decodes a Manifest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Manifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Manifest; + + /** + * Verifies a Manifest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Manifest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Manifest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Manifest; + + /** + * Creates a plain object from a Manifest message. Also converts values to other types if specified. + * @param message Manifest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Manifest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Manifest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Manifest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Manifest { + + /** ManifestType enum. */ + enum ManifestType { + MANIFEST_TYPE_UNSPECIFIED = 0, + HLS = 1, + DASH = 2 + } + } + + /** Properties of a SpriteSheet. */ + interface ISpriteSheet { + + /** SpriteSheet format */ + format?: (string|null); + + /** SpriteSheet filePrefix */ + filePrefix?: (string|null); + + /** SpriteSheet spriteWidthPixels */ + spriteWidthPixels?: (number|null); + + /** SpriteSheet spriteHeightPixels */ + spriteHeightPixels?: (number|null); + + /** SpriteSheet columnCount */ + columnCount?: (number|null); + + /** SpriteSheet rowCount */ + rowCount?: (number|null); + + /** SpriteSheet interval */ + interval?: (google.protobuf.IDuration|null); + + /** SpriteSheet quality */ + quality?: (number|null); + } + + /** Represents a SpriteSheet. */ + class SpriteSheet implements ISpriteSheet { + + /** + * Constructs a new SpriteSheet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ISpriteSheet); + + /** SpriteSheet format. */ + public format: string; + + /** SpriteSheet filePrefix. */ + public filePrefix: string; + + /** SpriteSheet spriteWidthPixels. */ + public spriteWidthPixels: number; + + /** SpriteSheet spriteHeightPixels. */ + public spriteHeightPixels: number; + + /** SpriteSheet columnCount. */ + public columnCount: number; + + /** SpriteSheet rowCount. */ + public rowCount: number; + + /** SpriteSheet interval. */ + public interval?: (google.protobuf.IDuration|null); + + /** SpriteSheet quality. */ + public quality: number; + + /** + * Creates a new SpriteSheet instance using the specified properties. + * @param [properties] Properties to set + * @returns SpriteSheet instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ISpriteSheet): google.cloud.video.livestream.v1.SpriteSheet; + + /** + * Encodes the specified SpriteSheet message. Does not implicitly {@link google.cloud.video.livestream.v1.SpriteSheet.verify|verify} messages. + * @param message SpriteSheet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ISpriteSheet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpriteSheet message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.SpriteSheet.verify|verify} messages. + * @param message SpriteSheet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ISpriteSheet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpriteSheet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpriteSheet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.SpriteSheet; + + /** + * Decodes a SpriteSheet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpriteSheet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.SpriteSheet; + + /** + * Verifies a SpriteSheet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpriteSheet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpriteSheet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.SpriteSheet; + + /** + * Creates a plain object from a SpriteSheet message. Also converts values to other types if specified. + * @param message SpriteSheet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.SpriteSheet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpriteSheet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpriteSheet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreprocessingConfig. */ + interface IPreprocessingConfig { + + /** PreprocessingConfig crop */ + crop?: (google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null); + + /** PreprocessingConfig pad */ + pad?: (google.cloud.video.livestream.v1.PreprocessingConfig.IPad|null); + } + + /** Represents a PreprocessingConfig. */ + class PreprocessingConfig implements IPreprocessingConfig { + + /** + * Constructs a new PreprocessingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IPreprocessingConfig); + + /** PreprocessingConfig crop. */ + public crop?: (google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null); + + /** PreprocessingConfig pad. */ + public pad?: (google.cloud.video.livestream.v1.PreprocessingConfig.IPad|null); + + /** + * Creates a new PreprocessingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PreprocessingConfig instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IPreprocessingConfig): google.cloud.video.livestream.v1.PreprocessingConfig; + + /** + * Encodes the specified PreprocessingConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.verify|verify} messages. + * @param message PreprocessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IPreprocessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreprocessingConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.verify|verify} messages. + * @param message PreprocessingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IPreprocessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreprocessingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreprocessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.PreprocessingConfig; + + /** + * Decodes a PreprocessingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreprocessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.PreprocessingConfig; + + /** + * Verifies a PreprocessingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreprocessingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreprocessingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.PreprocessingConfig; + + /** + * Creates a plain object from a PreprocessingConfig message. Also converts values to other types if specified. + * @param message PreprocessingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.PreprocessingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreprocessingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreprocessingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PreprocessingConfig { + + /** Properties of a Crop. */ + interface ICrop { + + /** Crop topPixels */ + topPixels?: (number|null); + + /** Crop bottomPixels */ + bottomPixels?: (number|null); + + /** Crop leftPixels */ + leftPixels?: (number|null); + + /** Crop rightPixels */ + rightPixels?: (number|null); + } + + /** Represents a Crop. */ + class Crop implements ICrop { + + /** + * Constructs a new Crop. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.PreprocessingConfig.ICrop); + + /** Crop topPixels. */ + public topPixels: number; + + /** Crop bottomPixels. */ + public bottomPixels: number; + + /** Crop leftPixels. */ + public leftPixels: number; + + /** Crop rightPixels. */ + public rightPixels: number; + + /** + * Creates a new Crop instance using the specified properties. + * @param [properties] Properties to set + * @returns Crop instance + */ + public static create(properties?: google.cloud.video.livestream.v1.PreprocessingConfig.ICrop): google.cloud.video.livestream.v1.PreprocessingConfig.Crop; + + /** + * Encodes the specified Crop message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Crop.verify|verify} messages. + * @param message Crop message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.PreprocessingConfig.ICrop, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Crop message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Crop.verify|verify} messages. + * @param message Crop message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.PreprocessingConfig.ICrop, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Crop message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Crop + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.PreprocessingConfig.Crop; + + /** + * Decodes a Crop message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Crop + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.PreprocessingConfig.Crop; + + /** + * Verifies a Crop message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Crop message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Crop + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.PreprocessingConfig.Crop; + + /** + * Creates a plain object from a Crop message. Also converts values to other types if specified. + * @param message Crop + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.PreprocessingConfig.Crop, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Crop to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Crop + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Pad. */ + interface IPad { + + /** Pad topPixels */ + topPixels?: (number|null); + + /** Pad bottomPixels */ + bottomPixels?: (number|null); + + /** Pad leftPixels */ + leftPixels?: (number|null); + + /** Pad rightPixels */ + rightPixels?: (number|null); + } + + /** Represents a Pad. */ + class Pad implements IPad { + + /** + * Constructs a new Pad. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.PreprocessingConfig.IPad); + + /** Pad topPixels. */ + public topPixels: number; + + /** Pad bottomPixels. */ + public bottomPixels: number; + + /** Pad leftPixels. */ + public leftPixels: number; + + /** Pad rightPixels. */ + public rightPixels: number; + + /** + * Creates a new Pad instance using the specified properties. + * @param [properties] Properties to set + * @returns Pad instance + */ + public static create(properties?: google.cloud.video.livestream.v1.PreprocessingConfig.IPad): google.cloud.video.livestream.v1.PreprocessingConfig.Pad; + + /** + * Encodes the specified Pad message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Pad.verify|verify} messages. + * @param message Pad message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.PreprocessingConfig.IPad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pad message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Pad.verify|verify} messages. + * @param message Pad message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.PreprocessingConfig.IPad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Pad message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Pad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.PreprocessingConfig.Pad; + + /** + * Decodes a Pad message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Pad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.PreprocessingConfig.Pad; + + /** + * Verifies a Pad message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Pad message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Pad + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.PreprocessingConfig.Pad; + + /** + * Creates a plain object from a Pad message. Also converts values to other types if specified. + * @param message Pad + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.PreprocessingConfig.Pad, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Pad to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Pad + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a VideoStream. */ + interface IVideoStream { + + /** VideoStream h264 */ + h264?: (google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings|null); + } + + /** Represents a VideoStream. */ + class VideoStream implements IVideoStream { + + /** + * Constructs a new VideoStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IVideoStream); + + /** VideoStream h264. */ + public h264?: (google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings|null); + + /** VideoStream codecSettings. */ + public codecSettings?: "h264"; + + /** + * Creates a new VideoStream instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoStream instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IVideoStream): google.cloud.video.livestream.v1.VideoStream; + + /** + * Encodes the specified VideoStream message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.verify|verify} messages. + * @param message VideoStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IVideoStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.verify|verify} messages. + * @param message VideoStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IVideoStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.VideoStream; + + /** + * Decodes a VideoStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.VideoStream; + + /** + * Verifies a VideoStream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoStream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.VideoStream; + + /** + * Creates a plain object from a VideoStream message. Also converts values to other types if specified. + * @param message VideoStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.VideoStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VideoStream { + + /** Properties of a H264CodecSettings. */ + interface IH264CodecSettings { + + /** H264CodecSettings widthPixels */ + widthPixels?: (number|null); + + /** H264CodecSettings heightPixels */ + heightPixels?: (number|null); + + /** H264CodecSettings frameRate */ + frameRate?: (number|null); + + /** H264CodecSettings bitrateBps */ + bitrateBps?: (number|null); + + /** H264CodecSettings allowOpenGop */ + allowOpenGop?: (boolean|null); + + /** H264CodecSettings gopFrameCount */ + gopFrameCount?: (number|null); + + /** H264CodecSettings gopDuration */ + gopDuration?: (google.protobuf.IDuration|null); + + /** H264CodecSettings vbvSizeBits */ + vbvSizeBits?: (number|null); + + /** H264CodecSettings vbvFullnessBits */ + vbvFullnessBits?: (number|null); + + /** H264CodecSettings entropyCoder */ + entropyCoder?: (string|null); + + /** H264CodecSettings bPyramid */ + bPyramid?: (boolean|null); + + /** H264CodecSettings bFrameCount */ + bFrameCount?: (number|null); + + /** H264CodecSettings aqStrength */ + aqStrength?: (number|null); + + /** H264CodecSettings profile */ + profile?: (string|null); + + /** H264CodecSettings tune */ + tune?: (string|null); + } + + /** Represents a H264CodecSettings. */ + class H264CodecSettings implements IH264CodecSettings { + + /** + * Constructs a new H264CodecSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings); + + /** H264CodecSettings widthPixels. */ + public widthPixels: number; + + /** H264CodecSettings heightPixels. */ + public heightPixels: number; + + /** H264CodecSettings frameRate. */ + public frameRate: number; + + /** H264CodecSettings bitrateBps. */ + public bitrateBps: number; + + /** H264CodecSettings allowOpenGop. */ + public allowOpenGop: boolean; + + /** H264CodecSettings gopFrameCount. */ + public gopFrameCount?: (number|null); + + /** H264CodecSettings gopDuration. */ + public gopDuration?: (google.protobuf.IDuration|null); + + /** H264CodecSettings vbvSizeBits. */ + public vbvSizeBits: number; + + /** H264CodecSettings vbvFullnessBits. */ + public vbvFullnessBits: number; + + /** H264CodecSettings entropyCoder. */ + public entropyCoder: string; + + /** H264CodecSettings bPyramid. */ + public bPyramid: boolean; + + /** H264CodecSettings bFrameCount. */ + public bFrameCount: number; + + /** H264CodecSettings aqStrength. */ + public aqStrength: number; + + /** H264CodecSettings profile. */ + public profile: string; + + /** H264CodecSettings tune. */ + public tune: string; + + /** H264CodecSettings gopMode. */ + public gopMode?: ("gopFrameCount"|"gopDuration"); + + /** + * Creates a new H264CodecSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns H264CodecSettings instance + */ + public static create(properties?: google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings): google.cloud.video.livestream.v1.VideoStream.H264CodecSettings; + + /** + * Encodes the specified H264CodecSettings message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.verify|verify} messages. + * @param message H264CodecSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified H264CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.verify|verify} messages. + * @param message H264CodecSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a H264CodecSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns H264CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.VideoStream.H264CodecSettings; + + /** + * Decodes a H264CodecSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns H264CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.VideoStream.H264CodecSettings; + + /** + * Verifies a H264CodecSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a H264CodecSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns H264CodecSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.VideoStream.H264CodecSettings; + + /** + * Creates a plain object from a H264CodecSettings message. Also converts values to other types if specified. + * @param message H264CodecSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.VideoStream.H264CodecSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this H264CodecSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for H264CodecSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AudioStream. */ + interface IAudioStream { + + /** AudioStream transmux */ + transmux?: (boolean|null); + + /** AudioStream codec */ + codec?: (string|null); + + /** AudioStream bitrateBps */ + bitrateBps?: (number|null); + + /** AudioStream channelCount */ + channelCount?: (number|null); + + /** AudioStream channelLayout */ + channelLayout?: (string[]|null); + + /** AudioStream mapping */ + mapping?: (google.cloud.video.livestream.v1.AudioStream.IAudioMapping[]|null); + + /** AudioStream sampleRateHertz */ + sampleRateHertz?: (number|null); + } + + /** Represents an AudioStream. */ + class AudioStream implements IAudioStream { + + /** + * Constructs a new AudioStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IAudioStream); + + /** AudioStream transmux. */ + public transmux: boolean; + + /** AudioStream codec. */ + public codec: string; + + /** AudioStream bitrateBps. */ + public bitrateBps: number; + + /** AudioStream channelCount. */ + public channelCount: number; + + /** AudioStream channelLayout. */ + public channelLayout: string[]; + + /** AudioStream mapping. */ + public mapping: google.cloud.video.livestream.v1.AudioStream.IAudioMapping[]; + + /** AudioStream sampleRateHertz. */ + public sampleRateHertz: number; + + /** + * Creates a new AudioStream instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioStream instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IAudioStream): google.cloud.video.livestream.v1.AudioStream; + + /** + * Encodes the specified AudioStream message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.verify|verify} messages. + * @param message AudioStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IAudioStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.verify|verify} messages. + * @param message AudioStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IAudioStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.AudioStream; + + /** + * Decodes an AudioStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.AudioStream; + + /** + * Verifies an AudioStream message. + * @param message Plain 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 AudioStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioStream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.AudioStream; + + /** + * Creates a plain object from an AudioStream message. Also converts values to other types if specified. + * @param message AudioStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.AudioStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AudioStream { + + /** Properties of an AudioMapping. */ + interface IAudioMapping { + + /** AudioMapping inputKey */ + inputKey?: (string|null); + + /** AudioMapping inputTrack */ + inputTrack?: (number|null); + + /** AudioMapping inputChannel */ + inputChannel?: (number|null); + + /** AudioMapping outputChannel */ + outputChannel?: (number|null); + } + + /** Represents an AudioMapping. */ + class AudioMapping implements IAudioMapping { + + /** + * Constructs a new AudioMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.AudioStream.IAudioMapping); + + /** AudioMapping inputKey. */ + public inputKey: string; + + /** AudioMapping inputTrack. */ + public inputTrack: number; + + /** AudioMapping inputChannel. */ + public inputChannel: number; + + /** AudioMapping outputChannel. */ + public outputChannel: number; + + /** + * Creates a new AudioMapping instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioMapping instance + */ + public static create(properties?: google.cloud.video.livestream.v1.AudioStream.IAudioMapping): google.cloud.video.livestream.v1.AudioStream.AudioMapping; + + /** + * Encodes the specified AudioMapping message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.AudioMapping.verify|verify} messages. + * @param message AudioMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.AudioStream.IAudioMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioMapping message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.AudioMapping.verify|verify} messages. + * @param message AudioMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.AudioStream.IAudioMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioMapping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.AudioStream.AudioMapping; + + /** + * Decodes an AudioMapping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.AudioStream.AudioMapping; + + /** + * Verifies an AudioMapping message. + * @param message Plain 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 AudioMapping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioMapping + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.AudioStream.AudioMapping; + + /** + * Creates a plain object from an AudioMapping message. Also converts values to other types if specified. + * @param message AudioMapping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.AudioStream.AudioMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioMapping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioMapping + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TextStream. */ + interface ITextStream { + + /** TextStream codec */ + codec?: (string|null); + } + + /** Represents a TextStream. */ + class TextStream implements ITextStream { + + /** + * Constructs a new TextStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ITextStream); + + /** TextStream codec. */ + public codec: string; + + /** + * Creates a new TextStream instance using the specified properties. + * @param [properties] Properties to set + * @returns TextStream instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ITextStream): google.cloud.video.livestream.v1.TextStream; + + /** + * Encodes the specified TextStream message. Does not implicitly {@link google.cloud.video.livestream.v1.TextStream.verify|verify} messages. + * @param message TextStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ITextStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.TextStream.verify|verify} messages. + * @param message TextStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ITextStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.TextStream; + + /** + * Decodes a TextStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.TextStream; + + /** + * Verifies a TextStream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextStream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.TextStream; + + /** + * Creates a plain object from a TextStream message. Also converts values to other types if specified. + * @param message TextStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.TextStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SegmentSettings. */ + interface ISegmentSettings { + + /** SegmentSettings segmentDuration */ + segmentDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a SegmentSettings. */ + class SegmentSettings implements ISegmentSettings { + + /** + * Constructs a new SegmentSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ISegmentSettings); + + /** SegmentSettings segmentDuration. */ + public segmentDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new SegmentSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentSettings instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ISegmentSettings): google.cloud.video.livestream.v1.SegmentSettings; + + /** + * Encodes the specified SegmentSettings message. Does not implicitly {@link google.cloud.video.livestream.v1.SegmentSettings.verify|verify} messages. + * @param message SegmentSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ISegmentSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentSettings message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.SegmentSettings.verify|verify} messages. + * @param message SegmentSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ISegmentSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SegmentSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SegmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.SegmentSettings; + + /** + * Decodes a SegmentSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SegmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.SegmentSettings; + + /** + * Verifies a SegmentSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SegmentSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SegmentSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.SegmentSettings; + + /** + * Creates a plain object from a SegmentSettings message. Also converts values to other types if specified. + * @param message SegmentSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.SegmentSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SegmentSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SegmentSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Input. */ + interface IInput { + + /** Input name */ + name?: (string|null); + + /** Input createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Input updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Input labels */ + labels?: ({ [k: string]: string }|null); + + /** Input type */ + type?: (google.cloud.video.livestream.v1.Input.Type|keyof typeof google.cloud.video.livestream.v1.Input.Type|null); + + /** Input tier */ + tier?: (google.cloud.video.livestream.v1.Input.Tier|keyof typeof google.cloud.video.livestream.v1.Input.Tier|null); + + /** Input uri */ + uri?: (string|null); + + /** Input preprocessingConfig */ + preprocessingConfig?: (google.cloud.video.livestream.v1.IPreprocessingConfig|null); + + /** Input securityRules */ + securityRules?: (google.cloud.video.livestream.v1.Input.ISecurityRule|null); + + /** Input inputStreamProperty */ + inputStreamProperty?: (google.cloud.video.livestream.v1.IInputStreamProperty|null); + } + + /** Represents an Input. */ + class Input implements IInput { + + /** + * Constructs a new Input. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IInput); + + /** Input name. */ + public name: string; + + /** Input createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Input updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Input labels. */ + public labels: { [k: string]: string }; + + /** Input type. */ + public type: (google.cloud.video.livestream.v1.Input.Type|keyof typeof google.cloud.video.livestream.v1.Input.Type); + + /** Input tier. */ + public tier: (google.cloud.video.livestream.v1.Input.Tier|keyof typeof google.cloud.video.livestream.v1.Input.Tier); + + /** Input uri. */ + public uri: string; + + /** Input preprocessingConfig. */ + public preprocessingConfig?: (google.cloud.video.livestream.v1.IPreprocessingConfig|null); + + /** Input securityRules. */ + public securityRules?: (google.cloud.video.livestream.v1.Input.ISecurityRule|null); + + /** Input inputStreamProperty. */ + public inputStreamProperty?: (google.cloud.video.livestream.v1.IInputStreamProperty|null); + + /** + * Creates a new Input instance using the specified properties. + * @param [properties] Properties to set + * @returns Input instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IInput): google.cloud.video.livestream.v1.Input; + + /** + * Encodes the specified Input message. Does not implicitly {@link google.cloud.video.livestream.v1.Input.verify|verify} messages. + * @param message Input message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Input.verify|verify} messages. + * @param message Input message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Input message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Input; + + /** + * Decodes an Input message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Input; + + /** + * Verifies an Input message. + * @param message Plain 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 Input message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Input + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Input; + + /** + * Creates a plain object from an Input message. Also converts values to other types if specified. + * @param message Input + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Input, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Input to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Input + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Input { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + RTMP_PUSH = 1, + SRT_PUSH = 2 + } + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + SD = 1, + HD = 2, + UHD = 3 + } + + /** Properties of a SecurityRule. */ + interface ISecurityRule { + + /** SecurityRule ipRanges */ + ipRanges?: (string[]|null); + } + + /** Represents a SecurityRule. */ + class SecurityRule implements ISecurityRule { + + /** + * Constructs a new SecurityRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Input.ISecurityRule); + + /** SecurityRule ipRanges. */ + public ipRanges: string[]; + + /** + * Creates a new SecurityRule instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityRule instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Input.ISecurityRule): google.cloud.video.livestream.v1.Input.SecurityRule; + + /** + * Encodes the specified SecurityRule message. Does not implicitly {@link google.cloud.video.livestream.v1.Input.SecurityRule.verify|verify} messages. + * @param message SecurityRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Input.ISecurityRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityRule message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Input.SecurityRule.verify|verify} messages. + * @param message SecurityRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Input.ISecurityRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Input.SecurityRule; + + /** + * Decodes a SecurityRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Input.SecurityRule; + + /** + * Verifies a SecurityRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Input.SecurityRule; + + /** + * Creates a plain object from a SecurityRule message. Also converts values to other types if specified. + * @param message SecurityRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Input.SecurityRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Channel. */ + interface IChannel { + + /** Channel name */ + name?: (string|null); + + /** Channel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Channel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Channel labels */ + labels?: ({ [k: string]: string }|null); + + /** Channel inputAttachments */ + inputAttachments?: (google.cloud.video.livestream.v1.IInputAttachment[]|null); + + /** Channel activeInput */ + activeInput?: (string|null); + + /** Channel output */ + output?: (google.cloud.video.livestream.v1.Channel.IOutput|null); + + /** Channel elementaryStreams */ + elementaryStreams?: (google.cloud.video.livestream.v1.IElementaryStream[]|null); + + /** Channel muxStreams */ + muxStreams?: (google.cloud.video.livestream.v1.IMuxStream[]|null); + + /** Channel manifests */ + manifests?: (google.cloud.video.livestream.v1.IManifest[]|null); + + /** Channel spriteSheets */ + spriteSheets?: (google.cloud.video.livestream.v1.ISpriteSheet[]|null); + + /** Channel streamingState */ + streamingState?: (google.cloud.video.livestream.v1.Channel.StreamingState|keyof typeof google.cloud.video.livestream.v1.Channel.StreamingState|null); + + /** Channel streamingError */ + streamingError?: (google.rpc.IStatus|null); + + /** Channel logConfig */ + logConfig?: (google.cloud.video.livestream.v1.ILogConfig|null); + } + + /** Represents a Channel. */ + class Channel implements IChannel { + + /** + * Constructs a new Channel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IChannel); + + /** Channel name. */ + public name: string; + + /** Channel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Channel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Channel labels. */ + public labels: { [k: string]: string }; + + /** Channel inputAttachments. */ + public inputAttachments: google.cloud.video.livestream.v1.IInputAttachment[]; + + /** Channel activeInput. */ + public activeInput: string; + + /** Channel output. */ + public output?: (google.cloud.video.livestream.v1.Channel.IOutput|null); + + /** Channel elementaryStreams. */ + public elementaryStreams: google.cloud.video.livestream.v1.IElementaryStream[]; + + /** Channel muxStreams. */ + public muxStreams: google.cloud.video.livestream.v1.IMuxStream[]; + + /** Channel manifests. */ + public manifests: google.cloud.video.livestream.v1.IManifest[]; + + /** Channel spriteSheets. */ + public spriteSheets: google.cloud.video.livestream.v1.ISpriteSheet[]; + + /** Channel streamingState. */ + public streamingState: (google.cloud.video.livestream.v1.Channel.StreamingState|keyof typeof google.cloud.video.livestream.v1.Channel.StreamingState); + + /** Channel streamingError. */ + public streamingError?: (google.rpc.IStatus|null); + + /** Channel logConfig. */ + public logConfig?: (google.cloud.video.livestream.v1.ILogConfig|null); + + /** + * Creates a new Channel instance using the specified properties. + * @param [properties] Properties to set + * @returns Channel instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IChannel): google.cloud.video.livestream.v1.Channel; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Channel; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Channel; + + /** + * Verifies a Channel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Channel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Channel; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @param message Channel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Channel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Channel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Channel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Channel { + + /** Properties of an Output. */ + interface IOutput { + + /** Output uri */ + uri?: (string|null); + } + + /** Represents an Output. */ + class Output implements IOutput { + + /** + * Constructs a new Output. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Channel.IOutput); + + /** Output uri. */ + public uri: string; + + /** + * Creates a new Output instance using the specified properties. + * @param [properties] Properties to set + * @returns Output instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Channel.IOutput): google.cloud.video.livestream.v1.Channel.Output; + + /** + * Encodes the specified Output message. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.Output.verify|verify} messages. + * @param message Output message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Channel.IOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Output message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.Output.verify|verify} messages. + * @param message Output message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Channel.IOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Output message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Channel.Output; + + /** + * Decodes an Output message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Channel.Output; + + /** + * Verifies an Output message. + * @param message Plain 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 Output message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Output + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Channel.Output; + + /** + * Creates a plain object from an Output message. Also converts values to other types if specified. + * @param message Output + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Channel.Output, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Output to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Output + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** StreamingState enum. */ + enum StreamingState { + STREAMING_STATE_UNSPECIFIED = 0, + STREAMING = 1, + AWAITING_INPUT = 2, + STREAMING_ERROR = 4, + STREAMING_NO_INPUT = 5, + STOPPED = 6, + STARTING = 7, + STOPPING = 8 + } + } + + /** Properties of a LogConfig. */ + interface ILogConfig { + + /** LogConfig logSeverity */ + logSeverity?: (google.cloud.video.livestream.v1.LogConfig.LogSeverity|keyof typeof google.cloud.video.livestream.v1.LogConfig.LogSeverity|null); + } + + /** Represents a LogConfig. */ + class LogConfig implements ILogConfig { + + /** + * Constructs a new LogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ILogConfig); + + /** LogConfig logSeverity. */ + public logSeverity: (google.cloud.video.livestream.v1.LogConfig.LogSeverity|keyof typeof google.cloud.video.livestream.v1.LogConfig.LogSeverity); + + /** + * Creates a new LogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LogConfig instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ILogConfig): google.cloud.video.livestream.v1.LogConfig; + + /** + * Encodes the specified LogConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.LogConfig.verify|verify} messages. + * @param message LogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ILogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.LogConfig.verify|verify} messages. + * @param message LogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ILogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.LogConfig; + + /** + * Decodes a LogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.LogConfig; + + /** + * Verifies a LogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.LogConfig; + + /** + * Creates a plain object from a LogConfig message. Also converts values to other types if specified. + * @param message LogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.LogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogConfig { + + /** LogSeverity enum. */ + enum LogSeverity { + LOG_SEVERITY_UNSPECIFIED = 0, + OFF = 1, + DEBUG = 100, + INFO = 200, + WARNING = 400, + ERROR = 500 + } + } + + /** Properties of an InputStreamProperty. */ + interface IInputStreamProperty { + + /** InputStreamProperty lastEstablishTime */ + lastEstablishTime?: (google.protobuf.ITimestamp|null); + + /** InputStreamProperty videoStreams */ + videoStreams?: (google.cloud.video.livestream.v1.IVideoStreamProperty[]|null); + + /** InputStreamProperty audioStreams */ + audioStreams?: (google.cloud.video.livestream.v1.IAudioStreamProperty[]|null); + } + + /** Represents an InputStreamProperty. */ + class InputStreamProperty implements IInputStreamProperty { + + /** + * Constructs a new InputStreamProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IInputStreamProperty); + + /** InputStreamProperty lastEstablishTime. */ + public lastEstablishTime?: (google.protobuf.ITimestamp|null); + + /** InputStreamProperty videoStreams. */ + public videoStreams: google.cloud.video.livestream.v1.IVideoStreamProperty[]; + + /** InputStreamProperty audioStreams. */ + public audioStreams: google.cloud.video.livestream.v1.IAudioStreamProperty[]; + + /** + * Creates a new InputStreamProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns InputStreamProperty instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IInputStreamProperty): google.cloud.video.livestream.v1.InputStreamProperty; + + /** + * Encodes the specified InputStreamProperty message. Does not implicitly {@link google.cloud.video.livestream.v1.InputStreamProperty.verify|verify} messages. + * @param message InputStreamProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IInputStreamProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputStreamProperty message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputStreamProperty.verify|verify} messages. + * @param message InputStreamProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IInputStreamProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputStreamProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.InputStreamProperty; + + /** + * Decodes an InputStreamProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.InputStreamProperty; + + /** + * Verifies an InputStreamProperty message. + * @param message Plain 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 InputStreamProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputStreamProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.InputStreamProperty; + + /** + * Creates a plain object from an InputStreamProperty message. Also converts values to other types if specified. + * @param message InputStreamProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.InputStreamProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputStreamProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputStreamProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoStreamProperty. */ + interface IVideoStreamProperty { + + /** VideoStreamProperty index */ + index?: (number|null); + + /** VideoStreamProperty videoFormat */ + videoFormat?: (google.cloud.video.livestream.v1.IVideoFormat|null); + } + + /** Represents a VideoStreamProperty. */ + class VideoStreamProperty implements IVideoStreamProperty { + + /** + * Constructs a new VideoStreamProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IVideoStreamProperty); + + /** VideoStreamProperty index. */ + public index: number; + + /** VideoStreamProperty videoFormat. */ + public videoFormat?: (google.cloud.video.livestream.v1.IVideoFormat|null); + + /** + * Creates a new VideoStreamProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoStreamProperty instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IVideoStreamProperty): google.cloud.video.livestream.v1.VideoStreamProperty; + + /** + * Encodes the specified VideoStreamProperty message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStreamProperty.verify|verify} messages. + * @param message VideoStreamProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IVideoStreamProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoStreamProperty message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStreamProperty.verify|verify} messages. + * @param message VideoStreamProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IVideoStreamProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoStreamProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.VideoStreamProperty; + + /** + * Decodes a VideoStreamProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.VideoStreamProperty; + + /** + * Verifies a VideoStreamProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoStreamProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoStreamProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.VideoStreamProperty; + + /** + * Creates a plain object from a VideoStreamProperty message. Also converts values to other types if specified. + * @param message VideoStreamProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.VideoStreamProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoStreamProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoStreamProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoFormat. */ + interface IVideoFormat { + + /** VideoFormat codec */ + codec?: (string|null); + + /** VideoFormat widthPixels */ + widthPixels?: (number|null); + + /** VideoFormat heightPixels */ + heightPixels?: (number|null); + + /** VideoFormat frameRate */ + frameRate?: (number|null); + } + + /** Represents a VideoFormat. */ + class VideoFormat implements IVideoFormat { + + /** + * Constructs a new VideoFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IVideoFormat); + + /** VideoFormat codec. */ + public codec: string; + + /** VideoFormat widthPixels. */ + public widthPixels: number; + + /** VideoFormat heightPixels. */ + public heightPixels: number; + + /** VideoFormat frameRate. */ + public frameRate: number; + + /** + * Creates a new VideoFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoFormat instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IVideoFormat): google.cloud.video.livestream.v1.VideoFormat; + + /** + * Encodes the specified VideoFormat message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoFormat.verify|verify} messages. + * @param message VideoFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IVideoFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoFormat message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoFormat.verify|verify} messages. + * @param message VideoFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IVideoFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.VideoFormat; + + /** + * Decodes a VideoFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.VideoFormat; + + /** + * Verifies a VideoFormat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoFormat + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.VideoFormat; + + /** + * Creates a plain object from a VideoFormat message. Also converts values to other types if specified. + * @param message VideoFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.VideoFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioStreamProperty. */ + interface IAudioStreamProperty { + + /** AudioStreamProperty index */ + index?: (number|null); + + /** AudioStreamProperty audioFormat */ + audioFormat?: (google.cloud.video.livestream.v1.IAudioFormat|null); + } + + /** Represents an AudioStreamProperty. */ + class AudioStreamProperty implements IAudioStreamProperty { + + /** + * Constructs a new AudioStreamProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IAudioStreamProperty); + + /** AudioStreamProperty index. */ + public index: number; + + /** AudioStreamProperty audioFormat. */ + public audioFormat?: (google.cloud.video.livestream.v1.IAudioFormat|null); + + /** + * Creates a new AudioStreamProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioStreamProperty instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IAudioStreamProperty): google.cloud.video.livestream.v1.AudioStreamProperty; + + /** + * Encodes the specified AudioStreamProperty message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStreamProperty.verify|verify} messages. + * @param message AudioStreamProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IAudioStreamProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioStreamProperty message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStreamProperty.verify|verify} messages. + * @param message AudioStreamProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IAudioStreamProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioStreamProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.AudioStreamProperty; + + /** + * Decodes an AudioStreamProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.AudioStreamProperty; + + /** + * Verifies an AudioStreamProperty message. + * @param message Plain 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 AudioStreamProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioStreamProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.AudioStreamProperty; + + /** + * Creates a plain object from an AudioStreamProperty message. Also converts values to other types if specified. + * @param message AudioStreamProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.AudioStreamProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioStreamProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioStreamProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AudioFormat. */ + interface IAudioFormat { + + /** AudioFormat codec */ + codec?: (string|null); + + /** AudioFormat channelCount */ + channelCount?: (number|null); + + /** AudioFormat channelLayout */ + channelLayout?: (string[]|null); + } + + /** Represents an AudioFormat. */ + class AudioFormat implements IAudioFormat { + + /** + * Constructs a new AudioFormat. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IAudioFormat); + + /** AudioFormat codec. */ + public codec: string; + + /** AudioFormat channelCount. */ + public channelCount: number; + + /** AudioFormat channelLayout. */ + public channelLayout: string[]; + + /** + * Creates a new AudioFormat instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioFormat instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IAudioFormat): google.cloud.video.livestream.v1.AudioFormat; + + /** + * Encodes the specified AudioFormat message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioFormat.verify|verify} messages. + * @param message AudioFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IAudioFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioFormat message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioFormat.verify|verify} messages. + * @param message AudioFormat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IAudioFormat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioFormat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.AudioFormat; + + /** + * Decodes an AudioFormat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.AudioFormat; + + /** + * Verifies an AudioFormat message. + * @param message Plain 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 AudioFormat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioFormat + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.AudioFormat; + + /** + * Creates a plain object from an AudioFormat message. Also converts values to other types if specified. + * @param message AudioFormat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.AudioFormat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioFormat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AudioFormat + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputAttachment. */ + interface IInputAttachment { + + /** InputAttachment key */ + key?: (string|null); + + /** InputAttachment input */ + input?: (string|null); + + /** InputAttachment automaticFailover */ + automaticFailover?: (google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover|null); + } + + /** Represents an InputAttachment. */ + class InputAttachment implements IInputAttachment { + + /** + * Constructs a new InputAttachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IInputAttachment); + + /** InputAttachment key. */ + public key: string; + + /** InputAttachment input. */ + public input: string; + + /** InputAttachment automaticFailover. */ + public automaticFailover?: (google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover|null); + + /** + * Creates a new InputAttachment instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAttachment instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IInputAttachment): google.cloud.video.livestream.v1.InputAttachment; + + /** + * Encodes the specified InputAttachment message. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.verify|verify} messages. + * @param message InputAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IInputAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAttachment message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.verify|verify} messages. + * @param message InputAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IInputAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAttachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.InputAttachment; + + /** + * Decodes an InputAttachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.InputAttachment; + + /** + * Verifies an InputAttachment message. + * @param message Plain 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 InputAttachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAttachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.InputAttachment; + + /** + * Creates a plain object from an InputAttachment message. Also converts values to other types if specified. + * @param message InputAttachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.InputAttachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAttachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputAttachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InputAttachment { + + /** Properties of an AutomaticFailover. */ + interface IAutomaticFailover { + + /** AutomaticFailover inputKeys */ + inputKeys?: (string[]|null); + } + + /** Represents an AutomaticFailover. */ + class AutomaticFailover implements IAutomaticFailover { + + /** + * Constructs a new AutomaticFailover. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover); + + /** AutomaticFailover inputKeys. */ + public inputKeys: string[]; + + /** + * Creates a new AutomaticFailover instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomaticFailover instance + */ + public static create(properties?: google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover): google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover; + + /** + * Encodes the specified AutomaticFailover message. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.verify|verify} messages. + * @param message AutomaticFailover message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomaticFailover message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.verify|verify} messages. + * @param message AutomaticFailover message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomaticFailover message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomaticFailover + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover; + + /** + * Decodes an AutomaticFailover message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomaticFailover + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover; + + /** + * Verifies an AutomaticFailover message. + * @param message Plain 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 AutomaticFailover message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomaticFailover + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover; + + /** + * Creates a plain object from an AutomaticFailover message. Also converts values to other types if specified. + * @param message AutomaticFailover + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomaticFailover to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomaticFailover + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Event. */ + interface IEvent { + + /** Event name */ + name?: (string|null); + + /** Event createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Event updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Event labels */ + labels?: ({ [k: string]: string }|null); + + /** Event adBreak */ + adBreak?: (google.cloud.video.livestream.v1.Event.IAdBreakTask|null); + + /** Event executeNow */ + executeNow?: (boolean|null); + + /** Event executionTime */ + executionTime?: (google.protobuf.ITimestamp|null); + + /** Event state */ + state?: (google.cloud.video.livestream.v1.Event.State|keyof typeof google.cloud.video.livestream.v1.Event.State|null); + + /** Event error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents an Event. */ + class Event implements IEvent { + + /** + * Constructs a new Event. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IEvent); + + /** Event name. */ + public name: string; + + /** Event createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Event updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Event labels. */ + public labels: { [k: string]: string }; + + /** Event adBreak. */ + public adBreak?: (google.cloud.video.livestream.v1.Event.IAdBreakTask|null); + + /** Event executeNow. */ + public executeNow: boolean; + + /** Event executionTime. */ + public executionTime?: (google.protobuf.ITimestamp|null); + + /** Event state. */ + public state: (google.cloud.video.livestream.v1.Event.State|keyof typeof google.cloud.video.livestream.v1.Event.State); + + /** Event error. */ + public error?: (google.rpc.IStatus|null); + + /** Event task. */ + public task?: "adBreak"; + + /** + * Creates a new Event instance using the specified properties. + * @param [properties] Properties to set + * @returns Event instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IEvent): google.cloud.video.livestream.v1.Event; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.verify|verify} messages. + * @param message Event message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Event message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event; + + /** + * Verifies an Event message. + * @param message Plain 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 Event message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Event + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @param message Event + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Event to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Event + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Event { + + /** Properties of an AdBreakTask. */ + interface IAdBreakTask { + + /** AdBreakTask duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents an AdBreakTask. */ + class AdBreakTask implements IAdBreakTask { + + /** + * Constructs a new AdBreakTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.Event.IAdBreakTask); + + /** AdBreakTask duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new AdBreakTask instance using the specified properties. + * @param [properties] Properties to set + * @returns AdBreakTask instance + */ + public static create(properties?: google.cloud.video.livestream.v1.Event.IAdBreakTask): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Encodes the specified AdBreakTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. + * @param message AdBreakTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.Event.IAdBreakTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdBreakTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. + * @param message AdBreakTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.Event.IAdBreakTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdBreakTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdBreakTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Decodes an AdBreakTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdBreakTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Verifies an AdBreakTask message. + * @param message Plain 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 AdBreakTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdBreakTask + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.Event.AdBreakTask; + + /** + * Creates a plain object from an AdBreakTask message. Also converts values to other types if specified. + * @param message AdBreakTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.Event.AdBreakTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdBreakTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdBreakTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SCHEDULED = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4, + PENDING = 5, + STOPPED = 6 + } + } + + /** Represents a LivestreamService */ + class LivestreamService extends $protobuf.rpc.Service { + + /** + * Constructs a new LivestreamService 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 LivestreamService 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): LivestreamService; + + /** + * Calls CreateChannel. + * @param request CreateChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createChannel(request: google.cloud.video.livestream.v1.ICreateChannelRequest, callback: google.cloud.video.livestream.v1.LivestreamService.CreateChannelCallback): void; + + /** + * Calls CreateChannel. + * @param request CreateChannelRequest message or plain object + * @returns Promise + */ + public createChannel(request: google.cloud.video.livestream.v1.ICreateChannelRequest): Promise; + + /** + * Calls ListChannels. + * @param request ListChannelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChannelsResponse + */ + public listChannels(request: google.cloud.video.livestream.v1.IListChannelsRequest, callback: google.cloud.video.livestream.v1.LivestreamService.ListChannelsCallback): void; + + /** + * Calls ListChannels. + * @param request ListChannelsRequest message or plain object + * @returns Promise + */ + public listChannels(request: google.cloud.video.livestream.v1.IListChannelsRequest): Promise; + + /** + * Calls GetChannel. + * @param request GetChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Channel + */ + public getChannel(request: google.cloud.video.livestream.v1.IGetChannelRequest, callback: google.cloud.video.livestream.v1.LivestreamService.GetChannelCallback): void; + + /** + * Calls GetChannel. + * @param request GetChannelRequest message or plain object + * @returns Promise + */ + public getChannel(request: google.cloud.video.livestream.v1.IGetChannelRequest): Promise; + + /** + * Calls DeleteChannel. + * @param request DeleteChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteChannel(request: google.cloud.video.livestream.v1.IDeleteChannelRequest, callback: google.cloud.video.livestream.v1.LivestreamService.DeleteChannelCallback): void; + + /** + * Calls DeleteChannel. + * @param request DeleteChannelRequest message or plain object + * @returns Promise + */ + public deleteChannel(request: google.cloud.video.livestream.v1.IDeleteChannelRequest): Promise; + + /** + * Calls UpdateChannel. + * @param request UpdateChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateChannel(request: google.cloud.video.livestream.v1.IUpdateChannelRequest, callback: google.cloud.video.livestream.v1.LivestreamService.UpdateChannelCallback): void; + + /** + * Calls UpdateChannel. + * @param request UpdateChannelRequest message or plain object + * @returns Promise + */ + public updateChannel(request: google.cloud.video.livestream.v1.IUpdateChannelRequest): Promise; + + /** + * Calls StartChannel. + * @param request StartChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startChannel(request: google.cloud.video.livestream.v1.IStartChannelRequest, callback: google.cloud.video.livestream.v1.LivestreamService.StartChannelCallback): void; + + /** + * Calls StartChannel. + * @param request StartChannelRequest message or plain object + * @returns Promise + */ + public startChannel(request: google.cloud.video.livestream.v1.IStartChannelRequest): Promise; + + /** + * Calls StopChannel. + * @param request StopChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopChannel(request: google.cloud.video.livestream.v1.IStopChannelRequest, callback: google.cloud.video.livestream.v1.LivestreamService.StopChannelCallback): void; + + /** + * Calls StopChannel. + * @param request StopChannelRequest message or plain object + * @returns Promise + */ + public stopChannel(request: google.cloud.video.livestream.v1.IStopChannelRequest): Promise; + + /** + * Calls CreateInput. + * @param request CreateInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInput(request: google.cloud.video.livestream.v1.ICreateInputRequest, callback: google.cloud.video.livestream.v1.LivestreamService.CreateInputCallback): void; + + /** + * Calls CreateInput. + * @param request CreateInputRequest message or plain object + * @returns Promise + */ + public createInput(request: google.cloud.video.livestream.v1.ICreateInputRequest): Promise; + + /** + * Calls ListInputs. + * @param request ListInputsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInputsResponse + */ + public listInputs(request: google.cloud.video.livestream.v1.IListInputsRequest, callback: google.cloud.video.livestream.v1.LivestreamService.ListInputsCallback): void; + + /** + * Calls ListInputs. + * @param request ListInputsRequest message or plain object + * @returns Promise + */ + public listInputs(request: google.cloud.video.livestream.v1.IListInputsRequest): Promise; + + /** + * Calls GetInput. + * @param request GetInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Input + */ + public getInput(request: google.cloud.video.livestream.v1.IGetInputRequest, callback: google.cloud.video.livestream.v1.LivestreamService.GetInputCallback): void; + + /** + * Calls GetInput. + * @param request GetInputRequest message or plain object + * @returns Promise + */ + public getInput(request: google.cloud.video.livestream.v1.IGetInputRequest): Promise; + + /** + * Calls DeleteInput. + * @param request DeleteInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInput(request: google.cloud.video.livestream.v1.IDeleteInputRequest, callback: google.cloud.video.livestream.v1.LivestreamService.DeleteInputCallback): void; + + /** + * Calls DeleteInput. + * @param request DeleteInputRequest message or plain object + * @returns Promise + */ + public deleteInput(request: google.cloud.video.livestream.v1.IDeleteInputRequest): Promise; + + /** + * Calls UpdateInput. + * @param request UpdateInputRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInput(request: google.cloud.video.livestream.v1.IUpdateInputRequest, callback: google.cloud.video.livestream.v1.LivestreamService.UpdateInputCallback): void; + + /** + * Calls UpdateInput. + * @param request UpdateInputRequest message or plain object + * @returns Promise + */ + public updateInput(request: google.cloud.video.livestream.v1.IUpdateInputRequest): Promise; + + /** + * Calls CreateEvent. + * @param request CreateEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Event + */ + public createEvent(request: google.cloud.video.livestream.v1.ICreateEventRequest, callback: google.cloud.video.livestream.v1.LivestreamService.CreateEventCallback): void; + + /** + * Calls CreateEvent. + * @param request CreateEventRequest message or plain object + * @returns Promise + */ + public createEvent(request: google.cloud.video.livestream.v1.ICreateEventRequest): Promise; + + /** + * Calls ListEvents. + * @param request ListEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEventsResponse + */ + public listEvents(request: google.cloud.video.livestream.v1.IListEventsRequest, callback: google.cloud.video.livestream.v1.LivestreamService.ListEventsCallback): void; + + /** + * Calls ListEvents. + * @param request ListEventsRequest message or plain object + * @returns Promise + */ + public listEvents(request: google.cloud.video.livestream.v1.IListEventsRequest): Promise; + + /** + * Calls GetEvent. + * @param request GetEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Event + */ + public getEvent(request: google.cloud.video.livestream.v1.IGetEventRequest, callback: google.cloud.video.livestream.v1.LivestreamService.GetEventCallback): void; + + /** + * Calls GetEvent. + * @param request GetEventRequest message or plain object + * @returns Promise + */ + public getEvent(request: google.cloud.video.livestream.v1.IGetEventRequest): Promise; + + /** + * Calls DeleteEvent. + * @param request DeleteEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEvent(request: google.cloud.video.livestream.v1.IDeleteEventRequest, callback: google.cloud.video.livestream.v1.LivestreamService.DeleteEventCallback): void; + + /** + * Calls DeleteEvent. + * @param request DeleteEventRequest message or plain object + * @returns Promise + */ + public deleteEvent(request: google.cloud.video.livestream.v1.IDeleteEventRequest): Promise; + } + + namespace LivestreamService { + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createChannel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateChannelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listChannels}. + * @param error Error, if any + * @param [response] ListChannelsResponse + */ + type ListChannelsCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.ListChannelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getChannel}. + * @param error Error, if any + * @param [response] Channel + */ + type GetChannelCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.Channel) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteChannel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteChannelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateChannel}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateChannelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|startChannel}. + * @param error Error, if any + * @param [response] Operation + */ + type StartChannelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|stopChannel}. + * @param error Error, if any + * @param [response] Operation + */ + type StopChannelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createInput}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInputCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listInputs}. + * @param error Error, if any + * @param [response] ListInputsResponse + */ + type ListInputsCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.ListInputsResponse) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getInput}. + * @param error Error, if any + * @param [response] Input + */ + type GetInputCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.Input) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteInput}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInputCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateInput}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInputCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createEvent}. + * @param error Error, if any + * @param [response] Event + */ + type CreateEventCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.Event) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listEvents}. + * @param error Error, if any + * @param [response] ListEventsResponse + */ + type ListEventsCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.ListEventsResponse) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getEvent}. + * @param error Error, if any + * @param [response] Event + */ + type GetEventCallback = (error: (Error|null), response?: google.cloud.video.livestream.v1.Event) => void; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteEvent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEventCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateChannelRequest. */ + interface ICreateChannelRequest { + + /** CreateChannelRequest parent */ + parent?: (string|null); + + /** CreateChannelRequest channel */ + channel?: (google.cloud.video.livestream.v1.IChannel|null); + + /** CreateChannelRequest channelId */ + channelId?: (string|null); + + /** CreateChannelRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateChannelRequest. */ + class CreateChannelRequest implements ICreateChannelRequest { + + /** + * Constructs a new CreateChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ICreateChannelRequest); + + /** CreateChannelRequest parent. */ + public parent: string; + + /** CreateChannelRequest channel. */ + public channel?: (google.cloud.video.livestream.v1.IChannel|null); + + /** CreateChannelRequest channelId. */ + public channelId: string; + + /** CreateChannelRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateChannelRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ICreateChannelRequest): google.cloud.video.livestream.v1.CreateChannelRequest; + + /** + * Encodes the specified CreateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * @param message CreateChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ICreateChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * @param message CreateChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ICreateChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.CreateChannelRequest; + + /** + * Decodes a CreateChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.CreateChannelRequest; + + /** + * Verifies a CreateChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.CreateChannelRequest; + + /** + * Creates a plain object from a CreateChannelRequest message. Also converts values to other types if specified. + * @param message CreateChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.CreateChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelsRequest. */ + interface IListChannelsRequest { + + /** ListChannelsRequest parent */ + parent?: (string|null); + + /** ListChannelsRequest pageSize */ + pageSize?: (number|null); + + /** ListChannelsRequest pageToken */ + pageToken?: (string|null); + + /** ListChannelsRequest filter */ + filter?: (string|null); + + /** ListChannelsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListChannelsRequest. */ + class ListChannelsRequest implements IListChannelsRequest { + + /** + * Constructs a new ListChannelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IListChannelsRequest); + + /** ListChannelsRequest parent. */ + public parent: string; + + /** ListChannelsRequest pageSize. */ + public pageSize: number; + + /** ListChannelsRequest pageToken. */ + public pageToken: string; + + /** ListChannelsRequest filter. */ + public filter: string; + + /** ListChannelsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListChannelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelsRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IListChannelsRequest): google.cloud.video.livestream.v1.ListChannelsRequest; + + /** + * Encodes the specified ListChannelsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. + * @param message ListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IListChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. + * @param message ListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IListChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ListChannelsRequest; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ListChannelsRequest; + + /** + * Verifies a ListChannelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ListChannelsRequest; + + /** + * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. + * @param message ListChannelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ListChannelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChannelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelsResponse. */ + interface IListChannelsResponse { + + /** ListChannelsResponse channels */ + channels?: (google.cloud.video.livestream.v1.IChannel[]|null); + + /** ListChannelsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListChannelsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListChannelsResponse. */ + class ListChannelsResponse implements IListChannelsResponse { + + /** + * Constructs a new ListChannelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IListChannelsResponse); + + /** ListChannelsResponse channels. */ + public channels: google.cloud.video.livestream.v1.IChannel[]; + + /** ListChannelsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListChannelsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListChannelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelsResponse instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IListChannelsResponse): google.cloud.video.livestream.v1.ListChannelsResponse; + + /** + * Encodes the specified ListChannelsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. + * @param message ListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IListChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. + * @param message ListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IListChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ListChannelsResponse; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ListChannelsResponse; + + /** + * Verifies a ListChannelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ListChannelsResponse; + + /** + * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. + * @param message ListChannelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ListChannelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChannelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChannelRequest. */ + interface IGetChannelRequest { + + /** GetChannelRequest name */ + name?: (string|null); + } + + /** Represents a GetChannelRequest. */ + class GetChannelRequest implements IGetChannelRequest { + + /** + * Constructs a new GetChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IGetChannelRequest); + + /** GetChannelRequest name. */ + public name: string; + + /** + * Creates a new GetChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChannelRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IGetChannelRequest): google.cloud.video.livestream.v1.GetChannelRequest; + + /** + * Encodes the specified GetChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. + * @param message GetChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IGetChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. + * @param message GetChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IGetChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.GetChannelRequest; + + /** + * Decodes a GetChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.GetChannelRequest; + + /** + * Verifies a GetChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.GetChannelRequest; + + /** + * Creates a plain object from a GetChannelRequest message. Also converts values to other types if specified. + * @param message GetChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.GetChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteChannelRequest. */ + interface IDeleteChannelRequest { + + /** DeleteChannelRequest name */ + name?: (string|null); + + /** DeleteChannelRequest requestId */ + requestId?: (string|null); + + /** DeleteChannelRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteChannelRequest. */ + class DeleteChannelRequest implements IDeleteChannelRequest { + + /** + * Constructs a new DeleteChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IDeleteChannelRequest); + + /** DeleteChannelRequest name. */ + public name: string; + + /** DeleteChannelRequest requestId. */ + public requestId: string; + + /** DeleteChannelRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteChannelRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IDeleteChannelRequest): google.cloud.video.livestream.v1.DeleteChannelRequest; + + /** + * Encodes the specified DeleteChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. + * @param message DeleteChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IDeleteChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. + * @param message DeleteChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IDeleteChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.DeleteChannelRequest; + + /** + * Decodes a DeleteChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.DeleteChannelRequest; + + /** + * Verifies a DeleteChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.DeleteChannelRequest; + + /** + * Creates a plain object from a DeleteChannelRequest message. Also converts values to other types if specified. + * @param message DeleteChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.DeleteChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelRequest. */ + interface IUpdateChannelRequest { + + /** UpdateChannelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateChannelRequest channel */ + channel?: (google.cloud.video.livestream.v1.IChannel|null); + + /** UpdateChannelRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateChannelRequest. */ + class UpdateChannelRequest implements IUpdateChannelRequest { + + /** + * Constructs a new UpdateChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IUpdateChannelRequest); + + /** UpdateChannelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateChannelRequest channel. */ + public channel?: (google.cloud.video.livestream.v1.IChannel|null); + + /** UpdateChannelRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChannelRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IUpdateChannelRequest): google.cloud.video.livestream.v1.UpdateChannelRequest; + + /** + * Encodes the specified UpdateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. + * @param message UpdateChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IUpdateChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. + * @param message UpdateChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IUpdateChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.UpdateChannelRequest; + + /** + * Decodes an UpdateChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.UpdateChannelRequest; + + /** + * Verifies an UpdateChannelRequest message. + * @param message Plain 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 UpdateChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.UpdateChannelRequest; + + /** + * Creates a plain object from an UpdateChannelRequest message. Also converts values to other types if specified. + * @param message UpdateChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.UpdateChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartChannelRequest. */ + interface IStartChannelRequest { + + /** StartChannelRequest name */ + name?: (string|null); + + /** StartChannelRequest requestId */ + requestId?: (string|null); + } + + /** Represents a StartChannelRequest. */ + class StartChannelRequest implements IStartChannelRequest { + + /** + * Constructs a new StartChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IStartChannelRequest); + + /** StartChannelRequest name. */ + public name: string; + + /** StartChannelRequest requestId. */ + public requestId: string; + + /** + * Creates a new StartChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartChannelRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IStartChannelRequest): google.cloud.video.livestream.v1.StartChannelRequest; + + /** + * Encodes the specified StartChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. + * @param message StartChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IStartChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. + * @param message StartChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IStartChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.StartChannelRequest; + + /** + * Decodes a StartChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.StartChannelRequest; + + /** + * Verifies a StartChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.StartChannelRequest; + + /** + * Creates a plain object from a StartChannelRequest message. Also converts values to other types if specified. + * @param message StartChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.StartChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopChannelRequest. */ + interface IStopChannelRequest { + + /** StopChannelRequest name */ + name?: (string|null); + + /** StopChannelRequest requestId */ + requestId?: (string|null); + } + + /** Represents a StopChannelRequest. */ + class StopChannelRequest implements IStopChannelRequest { + + /** + * Constructs a new StopChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IStopChannelRequest); + + /** StopChannelRequest name. */ + public name: string; + + /** StopChannelRequest requestId. */ + public requestId: string; + + /** + * Creates a new StopChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopChannelRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IStopChannelRequest): google.cloud.video.livestream.v1.StopChannelRequest; + + /** + * Encodes the specified StopChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. + * @param message StopChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IStopChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. + * @param message StopChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IStopChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.StopChannelRequest; + + /** + * Decodes a StopChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.StopChannelRequest; + + /** + * Verifies a StopChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopChannelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.StopChannelRequest; + + /** + * Creates a plain object from a StopChannelRequest message. Also converts values to other types if specified. + * @param message StopChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.StopChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInputRequest. */ + interface ICreateInputRequest { + + /** CreateInputRequest parent */ + parent?: (string|null); + + /** CreateInputRequest input */ + input?: (google.cloud.video.livestream.v1.IInput|null); + + /** CreateInputRequest inputId */ + inputId?: (string|null); + + /** CreateInputRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInputRequest. */ + class CreateInputRequest implements ICreateInputRequest { + + /** + * Constructs a new CreateInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ICreateInputRequest); + + /** CreateInputRequest parent. */ + public parent: string; + + /** CreateInputRequest input. */ + public input?: (google.cloud.video.livestream.v1.IInput|null); + + /** CreateInputRequest inputId. */ + public inputId: string; + + /** CreateInputRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInputRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ICreateInputRequest): google.cloud.video.livestream.v1.CreateInputRequest; + + /** + * Encodes the specified CreateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. + * @param message CreateInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ICreateInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. + * @param message CreateInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ICreateInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.CreateInputRequest; + + /** + * Decodes a CreateInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.CreateInputRequest; + + /** + * Verifies a CreateInputRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.CreateInputRequest; + + /** + * Creates a plain object from a CreateInputRequest message. Also converts values to other types if specified. + * @param message CreateInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.CreateInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInputsRequest. */ + interface IListInputsRequest { + + /** ListInputsRequest parent */ + parent?: (string|null); + + /** ListInputsRequest pageSize */ + pageSize?: (number|null); + + /** ListInputsRequest pageToken */ + pageToken?: (string|null); + + /** ListInputsRequest filter */ + filter?: (string|null); + + /** ListInputsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInputsRequest. */ + class ListInputsRequest implements IListInputsRequest { + + /** + * Constructs a new ListInputsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IListInputsRequest); + + /** ListInputsRequest parent. */ + public parent: string; + + /** ListInputsRequest pageSize. */ + public pageSize: number; + + /** ListInputsRequest pageToken. */ + public pageToken: string; + + /** ListInputsRequest filter. */ + public filter: string; + + /** ListInputsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInputsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInputsRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IListInputsRequest): google.cloud.video.livestream.v1.ListInputsRequest; + + /** + * Encodes the specified ListInputsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. + * @param message ListInputsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IListInputsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInputsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. + * @param message ListInputsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IListInputsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInputsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInputsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ListInputsRequest; + + /** + * Decodes a ListInputsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInputsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ListInputsRequest; + + /** + * Verifies a ListInputsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInputsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInputsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ListInputsRequest; + + /** + * Creates a plain object from a ListInputsRequest message. Also converts values to other types if specified. + * @param message ListInputsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ListInputsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInputsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInputsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInputsResponse. */ + interface IListInputsResponse { + + /** ListInputsResponse inputs */ + inputs?: (google.cloud.video.livestream.v1.IInput[]|null); + + /** ListInputsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInputsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInputsResponse. */ + class ListInputsResponse implements IListInputsResponse { + + /** + * Constructs a new ListInputsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IListInputsResponse); + + /** ListInputsResponse inputs. */ + public inputs: google.cloud.video.livestream.v1.IInput[]; + + /** ListInputsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInputsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInputsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInputsResponse instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IListInputsResponse): google.cloud.video.livestream.v1.ListInputsResponse; + + /** + * Encodes the specified ListInputsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. + * @param message ListInputsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IListInputsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInputsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. + * @param message ListInputsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IListInputsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInputsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInputsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ListInputsResponse; + + /** + * Decodes a ListInputsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInputsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ListInputsResponse; + + /** + * Verifies a ListInputsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInputsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInputsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ListInputsResponse; + + /** + * Creates a plain object from a ListInputsResponse message. Also converts values to other types if specified. + * @param message ListInputsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ListInputsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInputsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInputsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInputRequest. */ + interface IGetInputRequest { + + /** GetInputRequest name */ + name?: (string|null); + } + + /** Represents a GetInputRequest. */ + class GetInputRequest implements IGetInputRequest { + + /** + * Constructs a new GetInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IGetInputRequest); + + /** GetInputRequest name. */ + public name: string; + + /** + * Creates a new GetInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInputRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IGetInputRequest): google.cloud.video.livestream.v1.GetInputRequest; + + /** + * Encodes the specified GetInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. + * @param message GetInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IGetInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. + * @param message GetInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IGetInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.GetInputRequest; + + /** + * Decodes a GetInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.GetInputRequest; + + /** + * Verifies a GetInputRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.GetInputRequest; + + /** + * Creates a plain object from a GetInputRequest message. Also converts values to other types if specified. + * @param message GetInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.GetInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInputRequest. */ + interface IDeleteInputRequest { + + /** DeleteInputRequest name */ + name?: (string|null); + + /** DeleteInputRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInputRequest. */ + class DeleteInputRequest implements IDeleteInputRequest { + + /** + * Constructs a new DeleteInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IDeleteInputRequest); + + /** DeleteInputRequest name. */ + public name: string; + + /** DeleteInputRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInputRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IDeleteInputRequest): google.cloud.video.livestream.v1.DeleteInputRequest; + + /** + * Encodes the specified DeleteInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * @param message DeleteInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IDeleteInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * @param message DeleteInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IDeleteInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.DeleteInputRequest; + + /** + * Decodes a DeleteInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.DeleteInputRequest; + + /** + * Verifies a DeleteInputRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.DeleteInputRequest; + + /** + * Creates a plain object from a DeleteInputRequest message. Also converts values to other types if specified. + * @param message DeleteInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.DeleteInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInputRequest. */ + interface IUpdateInputRequest { + + /** UpdateInputRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInputRequest input */ + input?: (google.cloud.video.livestream.v1.IInput|null); + + /** UpdateInputRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateInputRequest. */ + class UpdateInputRequest implements IUpdateInputRequest { + + /** + * Constructs a new UpdateInputRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IUpdateInputRequest); + + /** UpdateInputRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInputRequest input. */ + public input?: (google.cloud.video.livestream.v1.IInput|null); + + /** UpdateInputRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateInputRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInputRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IUpdateInputRequest): google.cloud.video.livestream.v1.UpdateInputRequest; + + /** + * Encodes the specified UpdateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * @param message UpdateInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IUpdateInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * @param message UpdateInputRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IUpdateInputRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInputRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.UpdateInputRequest; + + /** + * Decodes an UpdateInputRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.UpdateInputRequest; + + /** + * Verifies an UpdateInputRequest message. + * @param message Plain 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 UpdateInputRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInputRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.UpdateInputRequest; + + /** + * Creates a plain object from an UpdateInputRequest message. Also converts values to other types if specified. + * @param message UpdateInputRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.UpdateInputRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInputRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInputRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEventRequest. */ + interface ICreateEventRequest { + + /** CreateEventRequest parent */ + parent?: (string|null); + + /** CreateEventRequest event */ + event?: (google.cloud.video.livestream.v1.IEvent|null); + + /** CreateEventRequest eventId */ + eventId?: (string|null); + + /** CreateEventRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateEventRequest. */ + class CreateEventRequest implements ICreateEventRequest { + + /** + * Constructs a new CreateEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.ICreateEventRequest); + + /** CreateEventRequest parent. */ + public parent: string; + + /** CreateEventRequest event. */ + public event?: (google.cloud.video.livestream.v1.IEvent|null); + + /** CreateEventRequest eventId. */ + public eventId: string; + + /** CreateEventRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEventRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.ICreateEventRequest): google.cloud.video.livestream.v1.CreateEventRequest; + + /** + * Encodes the specified CreateEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * @param message CreateEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.ICreateEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * @param message CreateEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.ICreateEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.CreateEventRequest; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.CreateEventRequest; + + /** + * Verifies a CreateEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.CreateEventRequest; + + /** + * Creates a plain object from a CreateEventRequest message. Also converts values to other types if specified. + * @param message CreateEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.CreateEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEventsRequest. */ + interface IListEventsRequest { + + /** ListEventsRequest parent */ + parent?: (string|null); + + /** ListEventsRequest pageSize */ + pageSize?: (number|null); + + /** ListEventsRequest pageToken */ + pageToken?: (string|null); + + /** ListEventsRequest filter */ + filter?: (string|null); + + /** ListEventsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListEventsRequest. */ + class ListEventsRequest implements IListEventsRequest { + + /** + * Constructs a new ListEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IListEventsRequest); + + /** ListEventsRequest parent. */ + public parent: string; + + /** ListEventsRequest pageSize. */ + public pageSize: number; + + /** ListEventsRequest pageToken. */ + public pageToken: string; + + /** ListEventsRequest filter. */ + public filter: string; + + /** ListEventsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEventsRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IListEventsRequest): google.cloud.video.livestream.v1.ListEventsRequest; + + /** + * Encodes the specified ListEventsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * @param message ListEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IListEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEventsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * @param message ListEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IListEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ListEventsRequest; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ListEventsRequest; + + /** + * Verifies a ListEventsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEventsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ListEventsRequest; + + /** + * Creates a plain object from a ListEventsRequest message. Also converts values to other types if specified. + * @param message ListEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ListEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEventsResponse. */ + interface IListEventsResponse { + + /** ListEventsResponse events */ + events?: (google.cloud.video.livestream.v1.IEvent[]|null); + + /** ListEventsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListEventsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListEventsResponse. */ + class ListEventsResponse implements IListEventsResponse { + + /** + * Constructs a new ListEventsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IListEventsResponse); + + /** ListEventsResponse events. */ + public events: google.cloud.video.livestream.v1.IEvent[]; + + /** ListEventsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListEventsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListEventsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEventsResponse instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IListEventsResponse): google.cloud.video.livestream.v1.ListEventsResponse; + + /** + * Encodes the specified ListEventsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * @param message ListEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IListEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEventsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * @param message ListEventsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IListEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ListEventsResponse; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ListEventsResponse; + + /** + * Verifies a ListEventsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEventsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEventsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ListEventsResponse; + + /** + * Creates a plain object from a ListEventsResponse message. Also converts values to other types if specified. + * @param message ListEventsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ListEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEventsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEventsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEventRequest. */ + interface IGetEventRequest { + + /** GetEventRequest name */ + name?: (string|null); + } + + /** Represents a GetEventRequest. */ + class GetEventRequest implements IGetEventRequest { + + /** + * Constructs a new GetEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IGetEventRequest); + + /** GetEventRequest name. */ + public name: string; + + /** + * Creates a new GetEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEventRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IGetEventRequest): google.cloud.video.livestream.v1.GetEventRequest; + + /** + * Encodes the specified GetEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * @param message GetEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IGetEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * @param message GetEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IGetEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.GetEventRequest; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.GetEventRequest; + + /** + * Verifies a GetEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.GetEventRequest; + + /** + * Creates a plain object from a GetEventRequest message. Also converts values to other types if specified. + * @param message GetEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.GetEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEventRequest. */ + interface IDeleteEventRequest { + + /** DeleteEventRequest name */ + name?: (string|null); + + /** DeleteEventRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteEventRequest. */ + class DeleteEventRequest implements IDeleteEventRequest { + + /** + * Constructs a new DeleteEventRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IDeleteEventRequest); + + /** DeleteEventRequest name. */ + public name: string; + + /** DeleteEventRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteEventRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEventRequest instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IDeleteEventRequest): google.cloud.video.livestream.v1.DeleteEventRequest; + + /** + * Encodes the specified DeleteEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * @param message DeleteEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IDeleteEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * @param message DeleteEventRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IDeleteEventRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.DeleteEventRequest; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.DeleteEventRequest; + + /** + * Verifies a DeleteEventRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEventRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEventRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.DeleteEventRequest; + + /** + * Creates a plain object from a DeleteEventRequest message. Also converts values to other types if specified. + * @param message DeleteEventRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.DeleteEventRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEventRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEventRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelOperationResponse. */ + interface IChannelOperationResponse { + } + + /** Represents a ChannelOperationResponse. */ + class ChannelOperationResponse implements IChannelOperationResponse { + + /** + * Constructs a new ChannelOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IChannelOperationResponse); + + /** + * Creates a new ChannelOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelOperationResponse instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IChannelOperationResponse): google.cloud.video.livestream.v1.ChannelOperationResponse; + + /** + * Encodes the specified ChannelOperationResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * @param message ChannelOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IChannelOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelOperationResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * @param message ChannelOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IChannelOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.ChannelOperationResponse; + + /** + * Decodes a ChannelOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.ChannelOperationResponse; + + /** + * Verifies a ChannelOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.ChannelOperationResponse; + + /** + * Creates a plain object from a ChannelOperationResponse message. Also converts values to other types if specified. + * @param message ChannelOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.v1.ChannelOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelOperationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.livestream.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.video.livestream.v1.IOperationMetadata): google.cloud.video.livestream.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.livestream.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.livestream.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.livestream.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.livestream.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.livestream.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.livestream.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 api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a 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 Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-video-livestream/protos/protos.js b/packages/google-cloud-video-livestream/protos/protos.js new file mode 100644 index 00000000000..e0568481596 --- /dev/null +++ b/packages/google-cloud-video-livestream/protos/protos.js @@ -0,0 +1,29154 @@ +// 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_livestream_protos || ($protobuf.roots._google_cloud_livestream_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.video = (function() { + + /** + * Namespace video. + * @memberof google.cloud + * @namespace + */ + var video = {}; + + video.livestream = (function() { + + /** + * Namespace livestream. + * @memberof google.cloud.video + * @namespace + */ + var livestream = {}; + + livestream.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.video.livestream + * @namespace + */ + var v1 = {}; + + v1.ElementaryStream = (function() { + + /** + * Properties of an ElementaryStream. + * @memberof google.cloud.video.livestream.v1 + * @interface IElementaryStream + * @property {string|null} [key] ElementaryStream key + * @property {google.cloud.video.livestream.v1.IVideoStream|null} [videoStream] ElementaryStream videoStream + * @property {google.cloud.video.livestream.v1.IAudioStream|null} [audioStream] ElementaryStream audioStream + * @property {google.cloud.video.livestream.v1.ITextStream|null} [textStream] ElementaryStream textStream + */ + + /** + * Constructs a new ElementaryStream. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an ElementaryStream. + * @implements IElementaryStream + * @constructor + * @param {google.cloud.video.livestream.v1.IElementaryStream=} [properties] Properties to set + */ + function ElementaryStream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ElementaryStream key. + * @member {string} key + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.key = ""; + + /** + * ElementaryStream videoStream. + * @member {google.cloud.video.livestream.v1.IVideoStream|null|undefined} videoStream + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.videoStream = null; + + /** + * ElementaryStream audioStream. + * @member {google.cloud.video.livestream.v1.IAudioStream|null|undefined} audioStream + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.audioStream = null; + + /** + * ElementaryStream textStream. + * @member {google.cloud.video.livestream.v1.ITextStream|null|undefined} textStream + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.textStream = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ElementaryStream elementaryStream. + * @member {"videoStream"|"audioStream"|"textStream"|undefined} elementaryStream + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @instance + */ + Object.defineProperty(ElementaryStream.prototype, "elementaryStream", { + get: $util.oneOfGetter($oneOfFields = ["videoStream", "audioStream", "textStream"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ElementaryStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {google.cloud.video.livestream.v1.IElementaryStream=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ElementaryStream} ElementaryStream instance + */ + ElementaryStream.create = function create(properties) { + return new ElementaryStream(properties); + }; + + /** + * Encodes the specified ElementaryStream message. Does not implicitly {@link google.cloud.video.livestream.v1.ElementaryStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {google.cloud.video.livestream.v1.IElementaryStream} message ElementaryStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ElementaryStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.videoStream != null && Object.hasOwnProperty.call(message, "videoStream")) + $root.google.cloud.video.livestream.v1.VideoStream.encode(message.videoStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audioStream != null && Object.hasOwnProperty.call(message, "audioStream")) + $root.google.cloud.video.livestream.v1.AudioStream.encode(message.audioStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.textStream != null && Object.hasOwnProperty.call(message, "textStream")) + $root.google.cloud.video.livestream.v1.TextStream.encode(message.textStream, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.key); + return writer; + }; + + /** + * Encodes the specified ElementaryStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ElementaryStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {google.cloud.video.livestream.v1.IElementaryStream} message ElementaryStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ElementaryStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ElementaryStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ElementaryStream} ElementaryStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ElementaryStream.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ElementaryStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.key = reader.string(); + break; + } + case 1: { + message.videoStream = $root.google.cloud.video.livestream.v1.VideoStream.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioStream = $root.google.cloud.video.livestream.v1.AudioStream.decode(reader, reader.uint32()); + break; + } + case 3: { + message.textStream = $root.google.cloud.video.livestream.v1.TextStream.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ElementaryStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ElementaryStream} ElementaryStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ElementaryStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ElementaryStream message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ElementaryStream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.videoStream != null && message.hasOwnProperty("videoStream")) { + properties.elementaryStream = 1; + { + var error = $root.google.cloud.video.livestream.v1.VideoStream.verify(message.videoStream); + if (error) + return "videoStream." + error; + } + } + if (message.audioStream != null && message.hasOwnProperty("audioStream")) { + if (properties.elementaryStream === 1) + return "elementaryStream: multiple values"; + properties.elementaryStream = 1; + { + var error = $root.google.cloud.video.livestream.v1.AudioStream.verify(message.audioStream); + if (error) + return "audioStream." + error; + } + } + if (message.textStream != null && message.hasOwnProperty("textStream")) { + if (properties.elementaryStream === 1) + return "elementaryStream: multiple values"; + properties.elementaryStream = 1; + { + var error = $root.google.cloud.video.livestream.v1.TextStream.verify(message.textStream); + if (error) + return "textStream." + error; + } + } + return null; + }; + + /** + * Creates an ElementaryStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ElementaryStream} ElementaryStream + */ + ElementaryStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ElementaryStream) + return object; + var message = new $root.google.cloud.video.livestream.v1.ElementaryStream(); + if (object.key != null) + message.key = String(object.key); + if (object.videoStream != null) { + if (typeof object.videoStream !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ElementaryStream.videoStream: object expected"); + message.videoStream = $root.google.cloud.video.livestream.v1.VideoStream.fromObject(object.videoStream); + } + if (object.audioStream != null) { + if (typeof object.audioStream !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ElementaryStream.audioStream: object expected"); + message.audioStream = $root.google.cloud.video.livestream.v1.AudioStream.fromObject(object.audioStream); + } + if (object.textStream != null) { + if (typeof object.textStream !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ElementaryStream.textStream: object expected"); + message.textStream = $root.google.cloud.video.livestream.v1.TextStream.fromObject(object.textStream); + } + return message; + }; + + /** + * Creates a plain object from an ElementaryStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {google.cloud.video.livestream.v1.ElementaryStream} message ElementaryStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ElementaryStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = ""; + if (message.videoStream != null && message.hasOwnProperty("videoStream")) { + object.videoStream = $root.google.cloud.video.livestream.v1.VideoStream.toObject(message.videoStream, options); + if (options.oneofs) + object.elementaryStream = "videoStream"; + } + if (message.audioStream != null && message.hasOwnProperty("audioStream")) { + object.audioStream = $root.google.cloud.video.livestream.v1.AudioStream.toObject(message.audioStream, options); + if (options.oneofs) + object.elementaryStream = "audioStream"; + } + if (message.textStream != null && message.hasOwnProperty("textStream")) { + object.textStream = $root.google.cloud.video.livestream.v1.TextStream.toObject(message.textStream, options); + if (options.oneofs) + object.elementaryStream = "textStream"; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this ElementaryStream to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @instance + * @returns {Object.} JSON object + */ + ElementaryStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ElementaryStream + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ElementaryStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ElementaryStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ElementaryStream"; + }; + + return ElementaryStream; + })(); + + v1.MuxStream = (function() { + + /** + * Properties of a MuxStream. + * @memberof google.cloud.video.livestream.v1 + * @interface IMuxStream + * @property {string|null} [key] MuxStream key + * @property {string|null} [container] MuxStream container + * @property {Array.|null} [elementaryStreams] MuxStream elementaryStreams + * @property {google.cloud.video.livestream.v1.ISegmentSettings|null} [segmentSettings] MuxStream segmentSettings + */ + + /** + * Constructs a new MuxStream. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a MuxStream. + * @implements IMuxStream + * @constructor + * @param {google.cloud.video.livestream.v1.IMuxStream=} [properties] Properties to set + */ + function MuxStream(properties) { + this.elementaryStreams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MuxStream key. + * @member {string} key + * @memberof google.cloud.video.livestream.v1.MuxStream + * @instance + */ + MuxStream.prototype.key = ""; + + /** + * MuxStream container. + * @member {string} container + * @memberof google.cloud.video.livestream.v1.MuxStream + * @instance + */ + MuxStream.prototype.container = ""; + + /** + * MuxStream elementaryStreams. + * @member {Array.} elementaryStreams + * @memberof google.cloud.video.livestream.v1.MuxStream + * @instance + */ + MuxStream.prototype.elementaryStreams = $util.emptyArray; + + /** + * MuxStream segmentSettings. + * @member {google.cloud.video.livestream.v1.ISegmentSettings|null|undefined} segmentSettings + * @memberof google.cloud.video.livestream.v1.MuxStream + * @instance + */ + MuxStream.prototype.segmentSettings = null; + + /** + * Creates a new MuxStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {google.cloud.video.livestream.v1.IMuxStream=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.MuxStream} MuxStream instance + */ + MuxStream.create = function create(properties) { + return new MuxStream(properties); + }; + + /** + * Encodes the specified MuxStream message. Does not implicitly {@link google.cloud.video.livestream.v1.MuxStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {google.cloud.video.livestream.v1.IMuxStream} message MuxStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuxStream.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.container != null && Object.hasOwnProperty.call(message, "container")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.container); + if (message.elementaryStreams != null && message.elementaryStreams.length) + for (var i = 0; i < message.elementaryStreams.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.elementaryStreams[i]); + if (message.segmentSettings != null && Object.hasOwnProperty.call(message, "segmentSettings")) + $root.google.cloud.video.livestream.v1.SegmentSettings.encode(message.segmentSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MuxStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.MuxStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {google.cloud.video.livestream.v1.IMuxStream} message MuxStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MuxStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MuxStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.MuxStream} MuxStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuxStream.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.MuxStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 3: { + message.container = reader.string(); + break; + } + case 4: { + if (!(message.elementaryStreams && message.elementaryStreams.length)) + message.elementaryStreams = []; + message.elementaryStreams.push(reader.string()); + break; + } + case 5: { + message.segmentSettings = $root.google.cloud.video.livestream.v1.SegmentSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MuxStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.MuxStream} MuxStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MuxStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MuxStream message. + * @function verify + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MuxStream.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.container != null && message.hasOwnProperty("container")) + if (!$util.isString(message.container)) + return "container: string expected"; + if (message.elementaryStreams != null && message.hasOwnProperty("elementaryStreams")) { + if (!Array.isArray(message.elementaryStreams)) + return "elementaryStreams: array expected"; + for (var i = 0; i < message.elementaryStreams.length; ++i) + if (!$util.isString(message.elementaryStreams[i])) + return "elementaryStreams: string[] expected"; + } + if (message.segmentSettings != null && message.hasOwnProperty("segmentSettings")) { + var error = $root.google.cloud.video.livestream.v1.SegmentSettings.verify(message.segmentSettings); + if (error) + return "segmentSettings." + error; + } + return null; + }; + + /** + * Creates a MuxStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.MuxStream} MuxStream + */ + MuxStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.MuxStream) + return object; + var message = new $root.google.cloud.video.livestream.v1.MuxStream(); + if (object.key != null) + message.key = String(object.key); + if (object.container != null) + message.container = String(object.container); + if (object.elementaryStreams) { + if (!Array.isArray(object.elementaryStreams)) + throw TypeError(".google.cloud.video.livestream.v1.MuxStream.elementaryStreams: array expected"); + message.elementaryStreams = []; + for (var i = 0; i < object.elementaryStreams.length; ++i) + message.elementaryStreams[i] = String(object.elementaryStreams[i]); + } + if (object.segmentSettings != null) { + if (typeof object.segmentSettings !== "object") + throw TypeError(".google.cloud.video.livestream.v1.MuxStream.segmentSettings: object expected"); + message.segmentSettings = $root.google.cloud.video.livestream.v1.SegmentSettings.fromObject(object.segmentSettings); + } + return message; + }; + + /** + * Creates a plain object from a MuxStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {google.cloud.video.livestream.v1.MuxStream} message MuxStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MuxStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.elementaryStreams = []; + if (options.defaults) { + object.key = ""; + object.container = ""; + object.segmentSettings = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.container != null && message.hasOwnProperty("container")) + object.container = message.container; + if (message.elementaryStreams && message.elementaryStreams.length) { + object.elementaryStreams = []; + for (var j = 0; j < message.elementaryStreams.length; ++j) + object.elementaryStreams[j] = message.elementaryStreams[j]; + } + if (message.segmentSettings != null && message.hasOwnProperty("segmentSettings")) + object.segmentSettings = $root.google.cloud.video.livestream.v1.SegmentSettings.toObject(message.segmentSettings, options); + return object; + }; + + /** + * Converts this MuxStream to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.MuxStream + * @instance + * @returns {Object.} JSON object + */ + MuxStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MuxStream + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.MuxStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MuxStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.MuxStream"; + }; + + return MuxStream; + })(); + + v1.Manifest = (function() { + + /** + * Properties of a Manifest. + * @memberof google.cloud.video.livestream.v1 + * @interface IManifest + * @property {string|null} [fileName] Manifest fileName + * @property {google.cloud.video.livestream.v1.Manifest.ManifestType|null} [type] Manifest type + * @property {Array.|null} [muxStreams] Manifest muxStreams + * @property {number|null} [maxSegmentCount] Manifest maxSegmentCount + * @property {google.protobuf.IDuration|null} [segmentKeepDuration] Manifest segmentKeepDuration + */ + + /** + * Constructs a new Manifest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a Manifest. + * @implements IManifest + * @constructor + * @param {google.cloud.video.livestream.v1.IManifest=} [properties] Properties to set + */ + function Manifest(properties) { + this.muxStreams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Manifest fileName. + * @member {string} fileName + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + */ + Manifest.prototype.fileName = ""; + + /** + * Manifest type. + * @member {google.cloud.video.livestream.v1.Manifest.ManifestType} type + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + */ + Manifest.prototype.type = 0; + + /** + * Manifest muxStreams. + * @member {Array.} muxStreams + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + */ + Manifest.prototype.muxStreams = $util.emptyArray; + + /** + * Manifest maxSegmentCount. + * @member {number} maxSegmentCount + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + */ + Manifest.prototype.maxSegmentCount = 0; + + /** + * Manifest segmentKeepDuration. + * @member {google.protobuf.IDuration|null|undefined} segmentKeepDuration + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + */ + Manifest.prototype.segmentKeepDuration = null; + + /** + * Creates a new Manifest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {google.cloud.video.livestream.v1.IManifest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Manifest} Manifest instance + */ + Manifest.create = function create(properties) { + return new Manifest(properties); + }; + + /** + * Encodes the specified Manifest message. Does not implicitly {@link google.cloud.video.livestream.v1.Manifest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {google.cloud.video.livestream.v1.IManifest} message Manifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Manifest.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); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.muxStreams != null && message.muxStreams.length) + for (var i = 0; i < message.muxStreams.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.muxStreams[i]); + if (message.maxSegmentCount != null && Object.hasOwnProperty.call(message, "maxSegmentCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxSegmentCount); + if (message.segmentKeepDuration != null && Object.hasOwnProperty.call(message, "segmentKeepDuration")) + $root.google.protobuf.Duration.encode(message.segmentKeepDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Manifest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Manifest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {google.cloud.video.livestream.v1.IManifest} message Manifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Manifest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Manifest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Manifest} Manifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Manifest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Manifest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fileName = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + if (!(message.muxStreams && message.muxStreams.length)) + message.muxStreams = []; + message.muxStreams.push(reader.string()); + break; + } + case 4: { + message.maxSegmentCount = reader.int32(); + break; + } + case 5: { + message.segmentKeepDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Manifest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Manifest} Manifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Manifest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Manifest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Manifest.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"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.muxStreams != null && message.hasOwnProperty("muxStreams")) { + if (!Array.isArray(message.muxStreams)) + return "muxStreams: array expected"; + for (var i = 0; i < message.muxStreams.length; ++i) + if (!$util.isString(message.muxStreams[i])) + return "muxStreams: string[] expected"; + } + if (message.maxSegmentCount != null && message.hasOwnProperty("maxSegmentCount")) + if (!$util.isInteger(message.maxSegmentCount)) + return "maxSegmentCount: integer expected"; + if (message.segmentKeepDuration != null && message.hasOwnProperty("segmentKeepDuration")) { + var error = $root.google.protobuf.Duration.verify(message.segmentKeepDuration); + if (error) + return "segmentKeepDuration." + error; + } + return null; + }; + + /** + * Creates a Manifest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Manifest} Manifest + */ + Manifest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Manifest) + return object; + var message = new $root.google.cloud.video.livestream.v1.Manifest(); + if (object.fileName != null) + message.fileName = String(object.fileName); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "MANIFEST_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "HLS": + case 1: + message.type = 1; + break; + case "DASH": + case 2: + message.type = 2; + break; + } + if (object.muxStreams) { + if (!Array.isArray(object.muxStreams)) + throw TypeError(".google.cloud.video.livestream.v1.Manifest.muxStreams: array expected"); + message.muxStreams = []; + for (var i = 0; i < object.muxStreams.length; ++i) + message.muxStreams[i] = String(object.muxStreams[i]); + } + if (object.maxSegmentCount != null) + message.maxSegmentCount = object.maxSegmentCount | 0; + if (object.segmentKeepDuration != null) { + if (typeof object.segmentKeepDuration !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Manifest.segmentKeepDuration: object expected"); + message.segmentKeepDuration = $root.google.protobuf.Duration.fromObject(object.segmentKeepDuration); + } + return message; + }; + + /** + * Creates a plain object from a Manifest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {google.cloud.video.livestream.v1.Manifest} message Manifest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Manifest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.muxStreams = []; + if (options.defaults) { + object.fileName = ""; + object.type = options.enums === String ? "MANIFEST_TYPE_UNSPECIFIED" : 0; + object.maxSegmentCount = 0; + object.segmentKeepDuration = null; + } + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.video.livestream.v1.Manifest.ManifestType[message.type] === undefined ? message.type : $root.google.cloud.video.livestream.v1.Manifest.ManifestType[message.type] : message.type; + if (message.muxStreams && message.muxStreams.length) { + object.muxStreams = []; + for (var j = 0; j < message.muxStreams.length; ++j) + object.muxStreams[j] = message.muxStreams[j]; + } + if (message.maxSegmentCount != null && message.hasOwnProperty("maxSegmentCount")) + object.maxSegmentCount = message.maxSegmentCount; + if (message.segmentKeepDuration != null && message.hasOwnProperty("segmentKeepDuration")) + object.segmentKeepDuration = $root.google.protobuf.Duration.toObject(message.segmentKeepDuration, options); + return object; + }; + + /** + * Converts this Manifest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Manifest + * @instance + * @returns {Object.} JSON object + */ + Manifest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Manifest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Manifest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Manifest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Manifest"; + }; + + /** + * ManifestType enum. + * @name google.cloud.video.livestream.v1.Manifest.ManifestType + * @enum {number} + * @property {number} MANIFEST_TYPE_UNSPECIFIED=0 MANIFEST_TYPE_UNSPECIFIED value + * @property {number} HLS=1 HLS value + * @property {number} DASH=2 DASH value + */ + Manifest.ManifestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANIFEST_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HLS"] = 1; + values[valuesById[2] = "DASH"] = 2; + return values; + })(); + + return Manifest; + })(); + + v1.SpriteSheet = (function() { + + /** + * Properties of a SpriteSheet. + * @memberof google.cloud.video.livestream.v1 + * @interface ISpriteSheet + * @property {string|null} [format] SpriteSheet format + * @property {string|null} [filePrefix] SpriteSheet filePrefix + * @property {number|null} [spriteWidthPixels] SpriteSheet spriteWidthPixels + * @property {number|null} [spriteHeightPixels] SpriteSheet spriteHeightPixels + * @property {number|null} [columnCount] SpriteSheet columnCount + * @property {number|null} [rowCount] SpriteSheet rowCount + * @property {google.protobuf.IDuration|null} [interval] SpriteSheet interval + * @property {number|null} [quality] SpriteSheet quality + */ + + /** + * Constructs a new SpriteSheet. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a SpriteSheet. + * @implements ISpriteSheet + * @constructor + * @param {google.cloud.video.livestream.v1.ISpriteSheet=} [properties] Properties to set + */ + function SpriteSheet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpriteSheet format. + * @member {string} format + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.format = ""; + + /** + * SpriteSheet filePrefix. + * @member {string} filePrefix + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.filePrefix = ""; + + /** + * SpriteSheet spriteWidthPixels. + * @member {number} spriteWidthPixels + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.spriteWidthPixels = 0; + + /** + * SpriteSheet spriteHeightPixels. + * @member {number} spriteHeightPixels + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.spriteHeightPixels = 0; + + /** + * SpriteSheet columnCount. + * @member {number} columnCount + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.columnCount = 0; + + /** + * SpriteSheet rowCount. + * @member {number} rowCount + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.rowCount = 0; + + /** + * SpriteSheet interval. + * @member {google.protobuf.IDuration|null|undefined} interval + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.interval = null; + + /** + * SpriteSheet quality. + * @member {number} quality + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.quality = 0; + + /** + * Creates a new SpriteSheet instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {google.cloud.video.livestream.v1.ISpriteSheet=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.SpriteSheet} SpriteSheet instance + */ + SpriteSheet.create = function create(properties) { + return new SpriteSheet(properties); + }; + + /** + * Encodes the specified SpriteSheet message. Does not implicitly {@link google.cloud.video.livestream.v1.SpriteSheet.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {google.cloud.video.livestream.v1.ISpriteSheet} message SpriteSheet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpriteSheet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.format); + if (message.filePrefix != null && Object.hasOwnProperty.call(message, "filePrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filePrefix); + if (message.spriteWidthPixels != null && Object.hasOwnProperty.call(message, "spriteWidthPixels")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.spriteWidthPixels); + if (message.spriteHeightPixels != null && Object.hasOwnProperty.call(message, "spriteHeightPixels")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.spriteHeightPixels); + if (message.columnCount != null && Object.hasOwnProperty.call(message, "columnCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.columnCount); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.rowCount); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.protobuf.Duration.encode(message.interval, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.quality != null && Object.hasOwnProperty.call(message, "quality")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.quality); + return writer; + }; + + /** + * Encodes the specified SpriteSheet message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.SpriteSheet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {google.cloud.video.livestream.v1.ISpriteSheet} message SpriteSheet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpriteSheet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpriteSheet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.SpriteSheet} SpriteSheet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpriteSheet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.SpriteSheet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.string(); + break; + } + case 2: { + message.filePrefix = reader.string(); + break; + } + case 3: { + message.spriteWidthPixels = reader.int32(); + break; + } + case 4: { + message.spriteHeightPixels = reader.int32(); + break; + } + case 5: { + message.columnCount = reader.int32(); + break; + } + case 6: { + message.rowCount = reader.int32(); + break; + } + case 7: { + message.interval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.quality = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpriteSheet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.SpriteSheet} SpriteSheet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpriteSheet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpriteSheet message. + * @function verify + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpriteSheet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isString(message.format)) + return "format: string expected"; + if (message.filePrefix != null && message.hasOwnProperty("filePrefix")) + if (!$util.isString(message.filePrefix)) + return "filePrefix: string expected"; + if (message.spriteWidthPixels != null && message.hasOwnProperty("spriteWidthPixels")) + if (!$util.isInteger(message.spriteWidthPixels)) + return "spriteWidthPixels: integer expected"; + if (message.spriteHeightPixels != null && message.hasOwnProperty("spriteHeightPixels")) + if (!$util.isInteger(message.spriteHeightPixels)) + return "spriteHeightPixels: integer expected"; + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + if (!$util.isInteger(message.columnCount)) + return "columnCount: integer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount)) + return "rowCount: integer expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.protobuf.Duration.verify(message.interval); + if (error) + return "interval." + error; + } + if (message.quality != null && message.hasOwnProperty("quality")) + if (!$util.isInteger(message.quality)) + return "quality: integer expected"; + return null; + }; + + /** + * Creates a SpriteSheet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.SpriteSheet} SpriteSheet + */ + SpriteSheet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.SpriteSheet) + return object; + var message = new $root.google.cloud.video.livestream.v1.SpriteSheet(); + if (object.format != null) + message.format = String(object.format); + if (object.filePrefix != null) + message.filePrefix = String(object.filePrefix); + if (object.spriteWidthPixels != null) + message.spriteWidthPixels = object.spriteWidthPixels | 0; + if (object.spriteHeightPixels != null) + message.spriteHeightPixels = object.spriteHeightPixels | 0; + if (object.columnCount != null) + message.columnCount = object.columnCount | 0; + if (object.rowCount != null) + message.rowCount = object.rowCount | 0; + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.video.livestream.v1.SpriteSheet.interval: object expected"); + message.interval = $root.google.protobuf.Duration.fromObject(object.interval); + } + if (object.quality != null) + message.quality = object.quality | 0; + return message; + }; + + /** + * Creates a plain object from a SpriteSheet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {google.cloud.video.livestream.v1.SpriteSheet} message SpriteSheet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpriteSheet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.format = ""; + object.filePrefix = ""; + object.spriteWidthPixels = 0; + object.spriteHeightPixels = 0; + object.columnCount = 0; + object.rowCount = 0; + object.interval = null; + object.quality = 0; + } + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.filePrefix != null && message.hasOwnProperty("filePrefix")) + object.filePrefix = message.filePrefix; + if (message.spriteWidthPixels != null && message.hasOwnProperty("spriteWidthPixels")) + object.spriteWidthPixels = message.spriteWidthPixels; + if (message.spriteHeightPixels != null && message.hasOwnProperty("spriteHeightPixels")) + object.spriteHeightPixels = message.spriteHeightPixels; + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + object.columnCount = message.columnCount; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + object.rowCount = message.rowCount; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.protobuf.Duration.toObject(message.interval, options); + if (message.quality != null && message.hasOwnProperty("quality")) + object.quality = message.quality; + return object; + }; + + /** + * Converts this SpriteSheet to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @instance + * @returns {Object.} JSON object + */ + SpriteSheet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpriteSheet + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.SpriteSheet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpriteSheet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.SpriteSheet"; + }; + + return SpriteSheet; + })(); + + v1.PreprocessingConfig = (function() { + + /** + * Properties of a PreprocessingConfig. + * @memberof google.cloud.video.livestream.v1 + * @interface IPreprocessingConfig + * @property {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null} [crop] PreprocessingConfig crop + * @property {google.cloud.video.livestream.v1.PreprocessingConfig.IPad|null} [pad] PreprocessingConfig pad + */ + + /** + * Constructs a new PreprocessingConfig. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a PreprocessingConfig. + * @implements IPreprocessingConfig + * @constructor + * @param {google.cloud.video.livestream.v1.IPreprocessingConfig=} [properties] Properties to set + */ + function PreprocessingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreprocessingConfig crop. + * @member {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop|null|undefined} crop + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.crop = null; + + /** + * PreprocessingConfig pad. + * @member {google.cloud.video.livestream.v1.PreprocessingConfig.IPad|null|undefined} pad + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.pad = null; + + /** + * Creates a new PreprocessingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.livestream.v1.IPreprocessingConfig=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig} PreprocessingConfig instance + */ + PreprocessingConfig.create = function create(properties) { + return new PreprocessingConfig(properties); + }; + + /** + * Encodes the specified PreprocessingConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.livestream.v1.IPreprocessingConfig} message PreprocessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreprocessingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.crop != null && Object.hasOwnProperty.call(message, "crop")) + $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.encode(message.crop, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pad != null && Object.hasOwnProperty.call(message, "pad")) + $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad.encode(message.pad, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreprocessingConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.livestream.v1.IPreprocessingConfig} message PreprocessingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreprocessingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreprocessingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig} PreprocessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreprocessingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.crop = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pad = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreprocessingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig} PreprocessingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreprocessingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreprocessingConfig message. + * @function verify + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreprocessingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.crop != null && message.hasOwnProperty("crop")) { + var error = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.verify(message.crop); + if (error) + return "crop." + error; + } + if (message.pad != null && message.hasOwnProperty("pad")) { + var error = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad.verify(message.pad); + if (error) + return "pad." + error; + } + return null; + }; + + /** + * Creates a PreprocessingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig} PreprocessingConfig + */ + PreprocessingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.PreprocessingConfig) + return object; + var message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig(); + if (object.crop != null) { + if (typeof object.crop !== "object") + throw TypeError(".google.cloud.video.livestream.v1.PreprocessingConfig.crop: object expected"); + message.crop = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.fromObject(object.crop); + } + if (object.pad != null) { + if (typeof object.pad !== "object") + throw TypeError(".google.cloud.video.livestream.v1.PreprocessingConfig.pad: object expected"); + message.pad = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad.fromObject(object.pad); + } + return message; + }; + + /** + * Creates a plain object from a PreprocessingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig} message PreprocessingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreprocessingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.crop = null; + object.pad = null; + } + if (message.crop != null && message.hasOwnProperty("crop")) + object.crop = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop.toObject(message.crop, options); + if (message.pad != null && message.hasOwnProperty("pad")) + object.pad = $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad.toObject(message.pad, options); + return object; + }; + + /** + * Converts this PreprocessingConfig to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @instance + * @returns {Object.} JSON object + */ + PreprocessingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreprocessingConfig + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreprocessingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.PreprocessingConfig"; + }; + + PreprocessingConfig.Crop = (function() { + + /** + * Properties of a Crop. + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @interface ICrop + * @property {number|null} [topPixels] Crop topPixels + * @property {number|null} [bottomPixels] Crop bottomPixels + * @property {number|null} [leftPixels] Crop leftPixels + * @property {number|null} [rightPixels] Crop rightPixels + */ + + /** + * Constructs a new Crop. + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @classdesc Represents a Crop. + * @implements ICrop + * @constructor + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop=} [properties] Properties to set + */ + function Crop(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Crop topPixels. + * @member {number} topPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.topPixels = 0; + + /** + * Crop bottomPixels. + * @member {number} bottomPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.bottomPixels = 0; + + /** + * Crop leftPixels. + * @member {number} leftPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.leftPixels = 0; + + /** + * Crop rightPixels. + * @member {number} rightPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.rightPixels = 0; + + /** + * Creates a new Crop instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Crop} Crop instance + */ + Crop.create = function create(properties) { + return new Crop(properties); + }; + + /** + * Encodes the specified Crop message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Crop.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop} message Crop message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Crop.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topPixels != null && Object.hasOwnProperty.call(message, "topPixels")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.topPixels); + if (message.bottomPixels != null && Object.hasOwnProperty.call(message, "bottomPixels")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bottomPixels); + if (message.leftPixels != null && Object.hasOwnProperty.call(message, "leftPixels")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leftPixels); + if (message.rightPixels != null && Object.hasOwnProperty.call(message, "rightPixels")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rightPixels); + return writer; + }; + + /** + * Encodes the specified Crop message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Crop.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.ICrop} message Crop message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Crop.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Crop message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Crop} Crop + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Crop.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topPixels = reader.int32(); + break; + } + case 2: { + message.bottomPixels = reader.int32(); + break; + } + case 3: { + message.leftPixels = reader.int32(); + break; + } + case 4: { + message.rightPixels = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Crop message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Crop} Crop + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Crop.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Crop message. + * @function verify + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Crop.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topPixels != null && message.hasOwnProperty("topPixels")) + if (!$util.isInteger(message.topPixels)) + return "topPixels: integer expected"; + if (message.bottomPixels != null && message.hasOwnProperty("bottomPixels")) + if (!$util.isInteger(message.bottomPixels)) + return "bottomPixels: integer expected"; + if (message.leftPixels != null && message.hasOwnProperty("leftPixels")) + if (!$util.isInteger(message.leftPixels)) + return "leftPixels: integer expected"; + if (message.rightPixels != null && message.hasOwnProperty("rightPixels")) + if (!$util.isInteger(message.rightPixels)) + return "rightPixels: integer expected"; + return null; + }; + + /** + * Creates a Crop message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Crop} Crop + */ + Crop.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop) + return object; + var message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig.Crop(); + if (object.topPixels != null) + message.topPixels = object.topPixels | 0; + if (object.bottomPixels != null) + message.bottomPixels = object.bottomPixels | 0; + if (object.leftPixels != null) + message.leftPixels = object.leftPixels | 0; + if (object.rightPixels != null) + message.rightPixels = object.rightPixels | 0; + return message; + }; + + /** + * Creates a plain object from a Crop message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.Crop} message Crop + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Crop.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topPixels = 0; + object.bottomPixels = 0; + object.leftPixels = 0; + object.rightPixels = 0; + } + if (message.topPixels != null && message.hasOwnProperty("topPixels")) + object.topPixels = message.topPixels; + if (message.bottomPixels != null && message.hasOwnProperty("bottomPixels")) + object.bottomPixels = message.bottomPixels; + if (message.leftPixels != null && message.hasOwnProperty("leftPixels")) + object.leftPixels = message.leftPixels; + if (message.rightPixels != null && message.hasOwnProperty("rightPixels")) + object.rightPixels = message.rightPixels; + return object; + }; + + /** + * Converts this Crop to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @instance + * @returns {Object.} JSON object + */ + Crop.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Crop + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Crop + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Crop.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.PreprocessingConfig.Crop"; + }; + + return Crop; + })(); + + PreprocessingConfig.Pad = (function() { + + /** + * Properties of a Pad. + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @interface IPad + * @property {number|null} [topPixels] Pad topPixels + * @property {number|null} [bottomPixels] Pad bottomPixels + * @property {number|null} [leftPixels] Pad leftPixels + * @property {number|null} [rightPixels] Pad rightPixels + */ + + /** + * Constructs a new Pad. + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig + * @classdesc Represents a Pad. + * @implements IPad + * @constructor + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IPad=} [properties] Properties to set + */ + function Pad(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Pad topPixels. + * @member {number} topPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.topPixels = 0; + + /** + * Pad bottomPixels. + * @member {number} bottomPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.bottomPixels = 0; + + /** + * Pad leftPixels. + * @member {number} leftPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.leftPixels = 0; + + /** + * Pad rightPixels. + * @member {number} rightPixels + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.rightPixels = 0; + + /** + * Creates a new Pad instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IPad=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Pad} Pad instance + */ + Pad.create = function create(properties) { + return new Pad(properties); + }; + + /** + * Encodes the specified Pad message. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Pad.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IPad} message Pad message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pad.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topPixels != null && Object.hasOwnProperty.call(message, "topPixels")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.topPixels); + if (message.bottomPixels != null && Object.hasOwnProperty.call(message, "bottomPixels")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bottomPixels); + if (message.leftPixels != null && Object.hasOwnProperty.call(message, "leftPixels")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leftPixels); + if (message.rightPixels != null && Object.hasOwnProperty.call(message, "rightPixels")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rightPixels); + return writer; + }; + + /** + * Encodes the specified Pad message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.PreprocessingConfig.Pad.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.IPad} message Pad message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Pad.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Pad message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Pad} Pad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pad.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topPixels = reader.int32(); + break; + } + case 2: { + message.bottomPixels = reader.int32(); + break; + } + case 3: { + message.leftPixels = reader.int32(); + break; + } + case 4: { + message.rightPixels = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Pad message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Pad} Pad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Pad.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Pad message. + * @function verify + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Pad.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topPixels != null && message.hasOwnProperty("topPixels")) + if (!$util.isInteger(message.topPixels)) + return "topPixels: integer expected"; + if (message.bottomPixels != null && message.hasOwnProperty("bottomPixels")) + if (!$util.isInteger(message.bottomPixels)) + return "bottomPixels: integer expected"; + if (message.leftPixels != null && message.hasOwnProperty("leftPixels")) + if (!$util.isInteger(message.leftPixels)) + return "leftPixels: integer expected"; + if (message.rightPixels != null && message.hasOwnProperty("rightPixels")) + if (!$util.isInteger(message.rightPixels)) + return "rightPixels: integer expected"; + return null; + }; + + /** + * Creates a Pad message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.PreprocessingConfig.Pad} Pad + */ + Pad.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad) + return object; + var message = new $root.google.cloud.video.livestream.v1.PreprocessingConfig.Pad(); + if (object.topPixels != null) + message.topPixels = object.topPixels | 0; + if (object.bottomPixels != null) + message.bottomPixels = object.bottomPixels | 0; + if (object.leftPixels != null) + message.leftPixels = object.leftPixels | 0; + if (object.rightPixels != null) + message.rightPixels = object.rightPixels | 0; + return message; + }; + + /** + * Creates a plain object from a Pad message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.livestream.v1.PreprocessingConfig.Pad} message Pad + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Pad.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topPixels = 0; + object.bottomPixels = 0; + object.leftPixels = 0; + object.rightPixels = 0; + } + if (message.topPixels != null && message.hasOwnProperty("topPixels")) + object.topPixels = message.topPixels; + if (message.bottomPixels != null && message.hasOwnProperty("bottomPixels")) + object.bottomPixels = message.bottomPixels; + if (message.leftPixels != null && message.hasOwnProperty("leftPixels")) + object.leftPixels = message.leftPixels; + if (message.rightPixels != null && message.hasOwnProperty("rightPixels")) + object.rightPixels = message.rightPixels; + return object; + }; + + /** + * Converts this Pad to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @instance + * @returns {Object.} JSON object + */ + Pad.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Pad + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.PreprocessingConfig.Pad + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Pad.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.PreprocessingConfig.Pad"; + }; + + return Pad; + })(); + + return PreprocessingConfig; + })(); + + v1.VideoStream = (function() { + + /** + * Properties of a VideoStream. + * @memberof google.cloud.video.livestream.v1 + * @interface IVideoStream + * @property {google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings|null} [h264] VideoStream h264 + */ + + /** + * Constructs a new VideoStream. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a VideoStream. + * @implements IVideoStream + * @constructor + * @param {google.cloud.video.livestream.v1.IVideoStream=} [properties] Properties to set + */ + function VideoStream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoStream h264. + * @member {google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings|null|undefined} h264 + * @memberof google.cloud.video.livestream.v1.VideoStream + * @instance + */ + VideoStream.prototype.h264 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VideoStream codecSettings. + * @member {"h264"|undefined} codecSettings + * @memberof google.cloud.video.livestream.v1.VideoStream + * @instance + */ + Object.defineProperty(VideoStream.prototype, "codecSettings", { + get: $util.oneOfGetter($oneOfFields = ["h264"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VideoStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {google.cloud.video.livestream.v1.IVideoStream=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.VideoStream} VideoStream instance + */ + VideoStream.create = function create(properties) { + return new VideoStream(properties); + }; + + /** + * Encodes the specified VideoStream message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {google.cloud.video.livestream.v1.IVideoStream} message VideoStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.h264 != null && Object.hasOwnProperty.call(message, "h264")) + $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.encode(message.h264, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {google.cloud.video.livestream.v1.IVideoStream} message VideoStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.VideoStream} VideoStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoStream.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.VideoStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 20: { + message.h264 = $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.VideoStream} VideoStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoStream message. + * @function verify + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoStream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.h264 != null && message.hasOwnProperty("h264")) { + properties.codecSettings = 1; + { + var error = $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.verify(message.h264); + if (error) + return "h264." + error; + } + } + return null; + }; + + /** + * Creates a VideoStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.VideoStream} VideoStream + */ + VideoStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.VideoStream) + return object; + var message = new $root.google.cloud.video.livestream.v1.VideoStream(); + if (object.h264 != null) { + if (typeof object.h264 !== "object") + throw TypeError(".google.cloud.video.livestream.v1.VideoStream.h264: object expected"); + message.h264 = $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.fromObject(object.h264); + } + return message; + }; + + /** + * Creates a plain object from a VideoStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {google.cloud.video.livestream.v1.VideoStream} message VideoStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.h264 != null && message.hasOwnProperty("h264")) { + object.h264 = $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.toObject(message.h264, options); + if (options.oneofs) + object.codecSettings = "h264"; + } + return object; + }; + + /** + * Converts this VideoStream to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.VideoStream + * @instance + * @returns {Object.} JSON object + */ + VideoStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoStream + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.VideoStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.VideoStream"; + }; + + VideoStream.H264CodecSettings = (function() { + + /** + * Properties of a H264CodecSettings. + * @memberof google.cloud.video.livestream.v1.VideoStream + * @interface IH264CodecSettings + * @property {number|null} [widthPixels] H264CodecSettings widthPixels + * @property {number|null} [heightPixels] H264CodecSettings heightPixels + * @property {number|null} [frameRate] H264CodecSettings frameRate + * @property {number|null} [bitrateBps] H264CodecSettings bitrateBps + * @property {boolean|null} [allowOpenGop] H264CodecSettings allowOpenGop + * @property {number|null} [gopFrameCount] H264CodecSettings gopFrameCount + * @property {google.protobuf.IDuration|null} [gopDuration] H264CodecSettings gopDuration + * @property {number|null} [vbvSizeBits] H264CodecSettings vbvSizeBits + * @property {number|null} [vbvFullnessBits] H264CodecSettings vbvFullnessBits + * @property {string|null} [entropyCoder] H264CodecSettings entropyCoder + * @property {boolean|null} [bPyramid] H264CodecSettings bPyramid + * @property {number|null} [bFrameCount] H264CodecSettings bFrameCount + * @property {number|null} [aqStrength] H264CodecSettings aqStrength + * @property {string|null} [profile] H264CodecSettings profile + * @property {string|null} [tune] H264CodecSettings tune + */ + + /** + * Constructs a new H264CodecSettings. + * @memberof google.cloud.video.livestream.v1.VideoStream + * @classdesc Represents a H264CodecSettings. + * @implements IH264CodecSettings + * @constructor + * @param {google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings=} [properties] Properties to set + */ + function H264CodecSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * H264CodecSettings widthPixels. + * @member {number} widthPixels + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.widthPixels = 0; + + /** + * H264CodecSettings heightPixels. + * @member {number} heightPixels + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.heightPixels = 0; + + /** + * H264CodecSettings frameRate. + * @member {number} frameRate + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.frameRate = 0; + + /** + * H264CodecSettings bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.bitrateBps = 0; + + /** + * H264CodecSettings allowOpenGop. + * @member {boolean} allowOpenGop + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.allowOpenGop = false; + + /** + * H264CodecSettings gopFrameCount. + * @member {number|null|undefined} gopFrameCount + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.gopFrameCount = null; + + /** + * H264CodecSettings gopDuration. + * @member {google.protobuf.IDuration|null|undefined} gopDuration + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.gopDuration = null; + + /** + * H264CodecSettings vbvSizeBits. + * @member {number} vbvSizeBits + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.vbvSizeBits = 0; + + /** + * H264CodecSettings vbvFullnessBits. + * @member {number} vbvFullnessBits + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.vbvFullnessBits = 0; + + /** + * H264CodecSettings entropyCoder. + * @member {string} entropyCoder + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.entropyCoder = ""; + + /** + * H264CodecSettings bPyramid. + * @member {boolean} bPyramid + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.bPyramid = false; + + /** + * H264CodecSettings bFrameCount. + * @member {number} bFrameCount + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.bFrameCount = 0; + + /** + * H264CodecSettings aqStrength. + * @member {number} aqStrength + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.aqStrength = 0; + + /** + * H264CodecSettings profile. + * @member {string} profile + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.profile = ""; + + /** + * H264CodecSettings tune. + * @member {string} tune + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.tune = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * H264CodecSettings gopMode. + * @member {"gopFrameCount"|"gopDuration"|undefined} gopMode + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + */ + Object.defineProperty(H264CodecSettings.prototype, "gopMode", { + get: $util.oneOfGetter($oneOfFields = ["gopFrameCount", "gopDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new H264CodecSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.VideoStream.H264CodecSettings} H264CodecSettings instance + */ + H264CodecSettings.create = function create(properties) { + return new H264CodecSettings(properties); + }; + + /** + * Encodes the specified H264CodecSettings message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings} message H264CodecSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + H264CodecSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.widthPixels != null && Object.hasOwnProperty.call(message, "widthPixels")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.widthPixels); + if (message.heightPixels != null && Object.hasOwnProperty.call(message, "heightPixels")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.heightPixels); + if (message.frameRate != null && Object.hasOwnProperty.call(message, "frameRate")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.frameRate); + if (message.bitrateBps != null && Object.hasOwnProperty.call(message, "bitrateBps")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.bitrateBps); + if (message.allowOpenGop != null && Object.hasOwnProperty.call(message, "allowOpenGop")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowOpenGop); + if (message.gopFrameCount != null && Object.hasOwnProperty.call(message, "gopFrameCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.gopFrameCount); + if (message.gopDuration != null && Object.hasOwnProperty.call(message, "gopDuration")) + $root.google.protobuf.Duration.encode(message.gopDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.vbvSizeBits != null && Object.hasOwnProperty.call(message, "vbvSizeBits")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.vbvSizeBits); + if (message.vbvFullnessBits != null && Object.hasOwnProperty.call(message, "vbvFullnessBits")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.vbvFullnessBits); + if (message.entropyCoder != null && Object.hasOwnProperty.call(message, "entropyCoder")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.entropyCoder); + if (message.bPyramid != null && Object.hasOwnProperty.call(message, "bPyramid")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.bPyramid); + if (message.bFrameCount != null && Object.hasOwnProperty.call(message, "bFrameCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.bFrameCount); + if (message.aqStrength != null && Object.hasOwnProperty.call(message, "aqStrength")) + writer.uint32(/* id 14, wireType 1 =*/113).double(message.aqStrength); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.profile); + if (message.tune != null && Object.hasOwnProperty.call(message, "tune")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.tune); + return writer; + }; + + /** + * Encodes the specified H264CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.livestream.v1.VideoStream.IH264CodecSettings} message H264CodecSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + H264CodecSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a H264CodecSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.VideoStream.H264CodecSettings} H264CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + H264CodecSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.widthPixels = reader.int32(); + break; + } + case 2: { + message.heightPixels = reader.int32(); + break; + } + case 3: { + message.frameRate = reader.double(); + break; + } + case 4: { + message.bitrateBps = reader.int32(); + break; + } + case 6: { + message.allowOpenGop = reader.bool(); + break; + } + case 7: { + message.gopFrameCount = reader.int32(); + break; + } + case 8: { + message.gopDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.vbvSizeBits = reader.int32(); + break; + } + case 10: { + message.vbvFullnessBits = reader.int32(); + break; + } + case 11: { + message.entropyCoder = reader.string(); + break; + } + case 12: { + message.bPyramid = reader.bool(); + break; + } + case 13: { + message.bFrameCount = reader.int32(); + break; + } + case 14: { + message.aqStrength = reader.double(); + break; + } + case 15: { + message.profile = reader.string(); + break; + } + case 16: { + message.tune = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a H264CodecSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.VideoStream.H264CodecSettings} H264CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + H264CodecSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a H264CodecSettings message. + * @function verify + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + H264CodecSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.widthPixels != null && message.hasOwnProperty("widthPixels")) + if (!$util.isInteger(message.widthPixels)) + return "widthPixels: integer expected"; + if (message.heightPixels != null && message.hasOwnProperty("heightPixels")) + if (!$util.isInteger(message.heightPixels)) + return "heightPixels: integer expected"; + if (message.frameRate != null && message.hasOwnProperty("frameRate")) + if (typeof message.frameRate !== "number") + return "frameRate: number expected"; + if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) + if (!$util.isInteger(message.bitrateBps)) + return "bitrateBps: integer expected"; + if (message.allowOpenGop != null && message.hasOwnProperty("allowOpenGop")) + if (typeof message.allowOpenGop !== "boolean") + return "allowOpenGop: boolean expected"; + if (message.gopFrameCount != null && message.hasOwnProperty("gopFrameCount")) { + properties.gopMode = 1; + if (!$util.isInteger(message.gopFrameCount)) + return "gopFrameCount: integer expected"; + } + if (message.gopDuration != null && message.hasOwnProperty("gopDuration")) { + if (properties.gopMode === 1) + return "gopMode: multiple values"; + properties.gopMode = 1; + { + var error = $root.google.protobuf.Duration.verify(message.gopDuration); + if (error) + return "gopDuration." + error; + } + } + if (message.vbvSizeBits != null && message.hasOwnProperty("vbvSizeBits")) + if (!$util.isInteger(message.vbvSizeBits)) + return "vbvSizeBits: integer expected"; + if (message.vbvFullnessBits != null && message.hasOwnProperty("vbvFullnessBits")) + if (!$util.isInteger(message.vbvFullnessBits)) + return "vbvFullnessBits: integer expected"; + if (message.entropyCoder != null && message.hasOwnProperty("entropyCoder")) + if (!$util.isString(message.entropyCoder)) + return "entropyCoder: string expected"; + if (message.bPyramid != null && message.hasOwnProperty("bPyramid")) + if (typeof message.bPyramid !== "boolean") + return "bPyramid: boolean expected"; + if (message.bFrameCount != null && message.hasOwnProperty("bFrameCount")) + if (!$util.isInteger(message.bFrameCount)) + return "bFrameCount: integer expected"; + if (message.aqStrength != null && message.hasOwnProperty("aqStrength")) + if (typeof message.aqStrength !== "number") + return "aqStrength: number expected"; + if (message.profile != null && message.hasOwnProperty("profile")) + if (!$util.isString(message.profile)) + return "profile: string expected"; + if (message.tune != null && message.hasOwnProperty("tune")) + if (!$util.isString(message.tune)) + return "tune: string expected"; + return null; + }; + + /** + * Creates a H264CodecSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.VideoStream.H264CodecSettings} H264CodecSettings + */ + H264CodecSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings) + return object; + var message = new $root.google.cloud.video.livestream.v1.VideoStream.H264CodecSettings(); + if (object.widthPixels != null) + message.widthPixels = object.widthPixels | 0; + if (object.heightPixels != null) + message.heightPixels = object.heightPixels | 0; + if (object.frameRate != null) + message.frameRate = Number(object.frameRate); + if (object.bitrateBps != null) + message.bitrateBps = object.bitrateBps | 0; + if (object.allowOpenGop != null) + message.allowOpenGop = Boolean(object.allowOpenGop); + if (object.gopFrameCount != null) + message.gopFrameCount = object.gopFrameCount | 0; + if (object.gopDuration != null) { + if (typeof object.gopDuration !== "object") + throw TypeError(".google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gopDuration: object expected"); + message.gopDuration = $root.google.protobuf.Duration.fromObject(object.gopDuration); + } + if (object.vbvSizeBits != null) + message.vbvSizeBits = object.vbvSizeBits | 0; + if (object.vbvFullnessBits != null) + message.vbvFullnessBits = object.vbvFullnessBits | 0; + if (object.entropyCoder != null) + message.entropyCoder = String(object.entropyCoder); + if (object.bPyramid != null) + message.bPyramid = Boolean(object.bPyramid); + if (object.bFrameCount != null) + message.bFrameCount = object.bFrameCount | 0; + if (object.aqStrength != null) + message.aqStrength = Number(object.aqStrength); + if (object.profile != null) + message.profile = String(object.profile); + if (object.tune != null) + message.tune = String(object.tune); + return message; + }; + + /** + * Creates a plain object from a H264CodecSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.livestream.v1.VideoStream.H264CodecSettings} message H264CodecSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + H264CodecSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.widthPixels = 0; + object.heightPixels = 0; + object.frameRate = 0; + object.bitrateBps = 0; + object.allowOpenGop = false; + object.vbvSizeBits = 0; + object.vbvFullnessBits = 0; + object.entropyCoder = ""; + object.bPyramid = false; + object.bFrameCount = 0; + object.aqStrength = 0; + object.profile = ""; + object.tune = ""; + } + if (message.widthPixels != null && message.hasOwnProperty("widthPixels")) + object.widthPixels = message.widthPixels; + if (message.heightPixels != null && message.hasOwnProperty("heightPixels")) + object.heightPixels = message.heightPixels; + if (message.frameRate != null && message.hasOwnProperty("frameRate")) + object.frameRate = options.json && !isFinite(message.frameRate) ? String(message.frameRate) : message.frameRate; + if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) + object.bitrateBps = message.bitrateBps; + if (message.allowOpenGop != null && message.hasOwnProperty("allowOpenGop")) + object.allowOpenGop = message.allowOpenGop; + if (message.gopFrameCount != null && message.hasOwnProperty("gopFrameCount")) { + object.gopFrameCount = message.gopFrameCount; + if (options.oneofs) + object.gopMode = "gopFrameCount"; + } + if (message.gopDuration != null && message.hasOwnProperty("gopDuration")) { + object.gopDuration = $root.google.protobuf.Duration.toObject(message.gopDuration, options); + if (options.oneofs) + object.gopMode = "gopDuration"; + } + if (message.vbvSizeBits != null && message.hasOwnProperty("vbvSizeBits")) + object.vbvSizeBits = message.vbvSizeBits; + if (message.vbvFullnessBits != null && message.hasOwnProperty("vbvFullnessBits")) + object.vbvFullnessBits = message.vbvFullnessBits; + if (message.entropyCoder != null && message.hasOwnProperty("entropyCoder")) + object.entropyCoder = message.entropyCoder; + if (message.bPyramid != null && message.hasOwnProperty("bPyramid")) + object.bPyramid = message.bPyramid; + if (message.bFrameCount != null && message.hasOwnProperty("bFrameCount")) + object.bFrameCount = message.bFrameCount; + if (message.aqStrength != null && message.hasOwnProperty("aqStrength")) + object.aqStrength = options.json && !isFinite(message.aqStrength) ? String(message.aqStrength) : message.aqStrength; + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = message.profile; + if (message.tune != null && message.hasOwnProperty("tune")) + object.tune = message.tune; + return object; + }; + + /** + * Converts this H264CodecSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @instance + * @returns {Object.} JSON object + */ + H264CodecSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for H264CodecSettings + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.VideoStream.H264CodecSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + H264CodecSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.VideoStream.H264CodecSettings"; + }; + + return H264CodecSettings; + })(); + + return VideoStream; + })(); + + v1.AudioStream = (function() { + + /** + * Properties of an AudioStream. + * @memberof google.cloud.video.livestream.v1 + * @interface IAudioStream + * @property {boolean|null} [transmux] AudioStream transmux + * @property {string|null} [codec] AudioStream codec + * @property {number|null} [bitrateBps] AudioStream bitrateBps + * @property {number|null} [channelCount] AudioStream channelCount + * @property {Array.|null} [channelLayout] AudioStream channelLayout + * @property {Array.|null} [mapping] AudioStream mapping + * @property {number|null} [sampleRateHertz] AudioStream sampleRateHertz + */ + + /** + * Constructs a new AudioStream. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an AudioStream. + * @implements IAudioStream + * @constructor + * @param {google.cloud.video.livestream.v1.IAudioStream=} [properties] Properties to set + */ + function AudioStream(properties) { + this.channelLayout = []; + this.mapping = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioStream transmux. + * @member {boolean} transmux + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.transmux = false; + + /** + * AudioStream codec. + * @member {string} codec + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.codec = ""; + + /** + * AudioStream bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.bitrateBps = 0; + + /** + * AudioStream channelCount. + * @member {number} channelCount + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.channelCount = 0; + + /** + * AudioStream channelLayout. + * @member {Array.} channelLayout + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.channelLayout = $util.emptyArray; + + /** + * AudioStream mapping. + * @member {Array.} mapping + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.mapping = $util.emptyArray; + + /** + * AudioStream sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + */ + AudioStream.prototype.sampleRateHertz = 0; + + /** + * Creates a new AudioStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {google.cloud.video.livestream.v1.IAudioStream=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.AudioStream} AudioStream instance + */ + AudioStream.create = function create(properties) { + return new AudioStream(properties); + }; + + /** + * Encodes the specified AudioStream message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {google.cloud.video.livestream.v1.IAudioStream} message AudioStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codec != null && Object.hasOwnProperty.call(message, "codec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.codec); + if (message.bitrateBps != null && Object.hasOwnProperty.call(message, "bitrateBps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bitrateBps); + if (message.channelCount != null && Object.hasOwnProperty.call(message, "channelCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.channelCount); + if (message.channelLayout != null && message.channelLayout.length) + for (var i = 0; i < message.channelLayout.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.channelLayout[i]); + if (message.mapping != null && message.mapping.length) + for (var i = 0; i < message.mapping.length; ++i) + $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping.encode(message.mapping[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.sampleRateHertz); + if (message.transmux != null && Object.hasOwnProperty.call(message, "transmux")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.transmux); + return writer; + }; + + /** + * Encodes the specified AudioStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {google.cloud.video.livestream.v1.IAudioStream} message AudioStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.AudioStream} AudioStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioStream.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.AudioStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.transmux = reader.bool(); + break; + } + case 1: { + message.codec = reader.string(); + break; + } + case 2: { + message.bitrateBps = reader.int32(); + break; + } + case 3: { + message.channelCount = reader.int32(); + break; + } + case 4: { + if (!(message.channelLayout && message.channelLayout.length)) + message.channelLayout = []; + message.channelLayout.push(reader.string()); + break; + } + case 5: { + if (!(message.mapping && message.mapping.length)) + message.mapping = []; + message.mapping.push($root.google.cloud.video.livestream.v1.AudioStream.AudioMapping.decode(reader, reader.uint32())); + break; + } + case 6: { + message.sampleRateHertz = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.AudioStream} AudioStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioStream message. + * @function verify + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioStream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transmux != null && message.hasOwnProperty("transmux")) + if (typeof message.transmux !== "boolean") + return "transmux: boolean expected"; + if (message.codec != null && message.hasOwnProperty("codec")) + if (!$util.isString(message.codec)) + return "codec: string expected"; + if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) + if (!$util.isInteger(message.bitrateBps)) + return "bitrateBps: integer expected"; + if (message.channelCount != null && message.hasOwnProperty("channelCount")) + if (!$util.isInteger(message.channelCount)) + return "channelCount: integer expected"; + if (message.channelLayout != null && message.hasOwnProperty("channelLayout")) { + if (!Array.isArray(message.channelLayout)) + return "channelLayout: array expected"; + for (var i = 0; i < message.channelLayout.length; ++i) + if (!$util.isString(message.channelLayout[i])) + return "channelLayout: string[] expected"; + } + if (message.mapping != null && message.hasOwnProperty("mapping")) { + if (!Array.isArray(message.mapping)) + return "mapping: array expected"; + for (var i = 0; i < message.mapping.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping.verify(message.mapping[i]); + if (error) + return "mapping." + error; + } + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + return null; + }; + + /** + * Creates an AudioStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.AudioStream} AudioStream + */ + AudioStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.AudioStream) + return object; + var message = new $root.google.cloud.video.livestream.v1.AudioStream(); + if (object.transmux != null) + message.transmux = Boolean(object.transmux); + if (object.codec != null) + message.codec = String(object.codec); + if (object.bitrateBps != null) + message.bitrateBps = object.bitrateBps | 0; + if (object.channelCount != null) + message.channelCount = object.channelCount | 0; + if (object.channelLayout) { + if (!Array.isArray(object.channelLayout)) + throw TypeError(".google.cloud.video.livestream.v1.AudioStream.channelLayout: array expected"); + message.channelLayout = []; + for (var i = 0; i < object.channelLayout.length; ++i) + message.channelLayout[i] = String(object.channelLayout[i]); + } + if (object.mapping) { + if (!Array.isArray(object.mapping)) + throw TypeError(".google.cloud.video.livestream.v1.AudioStream.mapping: array expected"); + message.mapping = []; + for (var i = 0; i < object.mapping.length; ++i) { + if (typeof object.mapping[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.AudioStream.mapping: object expected"); + message.mapping[i] = $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping.fromObject(object.mapping[i]); + } + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + return message; + }; + + /** + * Creates a plain object from an AudioStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {google.cloud.video.livestream.v1.AudioStream} message AudioStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.channelLayout = []; + object.mapping = []; + } + if (options.defaults) { + object.codec = ""; + object.bitrateBps = 0; + object.channelCount = 0; + object.sampleRateHertz = 0; + object.transmux = false; + } + if (message.codec != null && message.hasOwnProperty("codec")) + object.codec = message.codec; + if (message.bitrateBps != null && message.hasOwnProperty("bitrateBps")) + object.bitrateBps = message.bitrateBps; + if (message.channelCount != null && message.hasOwnProperty("channelCount")) + object.channelCount = message.channelCount; + if (message.channelLayout && message.channelLayout.length) { + object.channelLayout = []; + for (var j = 0; j < message.channelLayout.length; ++j) + object.channelLayout[j] = message.channelLayout[j]; + } + if (message.mapping && message.mapping.length) { + object.mapping = []; + for (var j = 0; j < message.mapping.length; ++j) + object.mapping[j] = $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping.toObject(message.mapping[j], options); + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.transmux != null && message.hasOwnProperty("transmux")) + object.transmux = message.transmux; + return object; + }; + + /** + * Converts this AudioStream to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.AudioStream + * @instance + * @returns {Object.} JSON object + */ + AudioStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioStream + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.AudioStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.AudioStream"; + }; + + AudioStream.AudioMapping = (function() { + + /** + * Properties of an AudioMapping. + * @memberof google.cloud.video.livestream.v1.AudioStream + * @interface IAudioMapping + * @property {string|null} [inputKey] AudioMapping inputKey + * @property {number|null} [inputTrack] AudioMapping inputTrack + * @property {number|null} [inputChannel] AudioMapping inputChannel + * @property {number|null} [outputChannel] AudioMapping outputChannel + */ + + /** + * Constructs a new AudioMapping. + * @memberof google.cloud.video.livestream.v1.AudioStream + * @classdesc Represents an AudioMapping. + * @implements IAudioMapping + * @constructor + * @param {google.cloud.video.livestream.v1.AudioStream.IAudioMapping=} [properties] Properties to set + */ + function AudioMapping(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioMapping inputKey. + * @member {string} inputKey + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.inputKey = ""; + + /** + * AudioMapping inputTrack. + * @member {number} inputTrack + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.inputTrack = 0; + + /** + * AudioMapping inputChannel. + * @member {number} inputChannel + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.inputChannel = 0; + + /** + * AudioMapping outputChannel. + * @member {number} outputChannel + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.outputChannel = 0; + + /** + * Creates a new AudioMapping instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.livestream.v1.AudioStream.IAudioMapping=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.AudioStream.AudioMapping} AudioMapping instance + */ + AudioMapping.create = function create(properties) { + return new AudioMapping(properties); + }; + + /** + * Encodes the specified AudioMapping message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.AudioMapping.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.livestream.v1.AudioStream.IAudioMapping} message AudioMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioMapping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputTrack != null && Object.hasOwnProperty.call(message, "inputTrack")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.inputTrack); + if (message.inputChannel != null && Object.hasOwnProperty.call(message, "inputChannel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.inputChannel); + if (message.outputChannel != null && Object.hasOwnProperty.call(message, "outputChannel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.outputChannel); + if (message.inputKey != null && Object.hasOwnProperty.call(message, "inputKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.inputKey); + return writer; + }; + + /** + * Encodes the specified AudioMapping message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStream.AudioMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.livestream.v1.AudioStream.IAudioMapping} message AudioMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioMapping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioMapping message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.AudioStream.AudioMapping} AudioMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioMapping.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.inputKey = reader.string(); + break; + } + case 2: { + message.inputTrack = reader.int32(); + break; + } + case 3: { + message.inputChannel = reader.int32(); + break; + } + case 4: { + message.outputChannel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioMapping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.AudioStream.AudioMapping} AudioMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioMapping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioMapping message. + * @function verify + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioMapping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputKey != null && message.hasOwnProperty("inputKey")) + if (!$util.isString(message.inputKey)) + return "inputKey: string expected"; + if (message.inputTrack != null && message.hasOwnProperty("inputTrack")) + if (!$util.isInteger(message.inputTrack)) + return "inputTrack: integer expected"; + if (message.inputChannel != null && message.hasOwnProperty("inputChannel")) + if (!$util.isInteger(message.inputChannel)) + return "inputChannel: integer expected"; + if (message.outputChannel != null && message.hasOwnProperty("outputChannel")) + if (!$util.isInteger(message.outputChannel)) + return "outputChannel: integer expected"; + return null; + }; + + /** + * Creates an AudioMapping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.AudioStream.AudioMapping} AudioMapping + */ + AudioMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping) + return object; + var message = new $root.google.cloud.video.livestream.v1.AudioStream.AudioMapping(); + if (object.inputKey != null) + message.inputKey = String(object.inputKey); + if (object.inputTrack != null) + message.inputTrack = object.inputTrack | 0; + if (object.inputChannel != null) + message.inputChannel = object.inputChannel | 0; + if (object.outputChannel != null) + message.outputChannel = object.outputChannel | 0; + return message; + }; + + /** + * Creates a plain object from an AudioMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.livestream.v1.AudioStream.AudioMapping} message AudioMapping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioMapping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputTrack = 0; + object.inputChannel = 0; + object.outputChannel = 0; + object.inputKey = ""; + } + if (message.inputTrack != null && message.hasOwnProperty("inputTrack")) + object.inputTrack = message.inputTrack; + if (message.inputChannel != null && message.hasOwnProperty("inputChannel")) + object.inputChannel = message.inputChannel; + if (message.outputChannel != null && message.hasOwnProperty("outputChannel")) + object.outputChannel = message.outputChannel; + if (message.inputKey != null && message.hasOwnProperty("inputKey")) + object.inputKey = message.inputKey; + return object; + }; + + /** + * Converts this AudioMapping to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @instance + * @returns {Object.} JSON object + */ + AudioMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioMapping + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.AudioStream.AudioMapping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.AudioStream.AudioMapping"; + }; + + return AudioMapping; + })(); + + return AudioStream; + })(); + + v1.TextStream = (function() { + + /** + * Properties of a TextStream. + * @memberof google.cloud.video.livestream.v1 + * @interface ITextStream + * @property {string|null} [codec] TextStream codec + */ + + /** + * Constructs a new TextStream. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a TextStream. + * @implements ITextStream + * @constructor + * @param {google.cloud.video.livestream.v1.ITextStream=} [properties] Properties to set + */ + function TextStream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextStream codec. + * @member {string} codec + * @memberof google.cloud.video.livestream.v1.TextStream + * @instance + */ + TextStream.prototype.codec = ""; + + /** + * Creates a new TextStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {google.cloud.video.livestream.v1.ITextStream=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.TextStream} TextStream instance + */ + TextStream.create = function create(properties) { + return new TextStream(properties); + }; + + /** + * Encodes the specified TextStream message. Does not implicitly {@link google.cloud.video.livestream.v1.TextStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {google.cloud.video.livestream.v1.ITextStream} message TextStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codec != null && Object.hasOwnProperty.call(message, "codec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.codec); + return writer; + }; + + /** + * Encodes the specified TextStream message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.TextStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {google.cloud.video.livestream.v1.ITextStream} message TextStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.TextStream} TextStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextStream.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.TextStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.codec = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.TextStream} TextStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextStream message. + * @function verify + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextStream.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.codec != null && message.hasOwnProperty("codec")) + if (!$util.isString(message.codec)) + return "codec: string expected"; + return null; + }; + + /** + * Creates a TextStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.TextStream} TextStream + */ + TextStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.TextStream) + return object; + var message = new $root.google.cloud.video.livestream.v1.TextStream(); + if (object.codec != null) + message.codec = String(object.codec); + return message; + }; + + /** + * Creates a plain object from a TextStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {google.cloud.video.livestream.v1.TextStream} message TextStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextStream.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.codec = ""; + if (message.codec != null && message.hasOwnProperty("codec")) + object.codec = message.codec; + return object; + }; + + /** + * Converts this TextStream to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.TextStream + * @instance + * @returns {Object.} JSON object + */ + TextStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextStream + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.TextStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.TextStream"; + }; + + return TextStream; + })(); + + v1.SegmentSettings = (function() { + + /** + * Properties of a SegmentSettings. + * @memberof google.cloud.video.livestream.v1 + * @interface ISegmentSettings + * @property {google.protobuf.IDuration|null} [segmentDuration] SegmentSettings segmentDuration + */ + + /** + * Constructs a new SegmentSettings. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a SegmentSettings. + * @implements ISegmentSettings + * @constructor + * @param {google.cloud.video.livestream.v1.ISegmentSettings=} [properties] Properties to set + */ + function SegmentSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SegmentSettings segmentDuration. + * @member {google.protobuf.IDuration|null|undefined} segmentDuration + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @instance + */ + SegmentSettings.prototype.segmentDuration = null; + + /** + * Creates a new SegmentSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {google.cloud.video.livestream.v1.ISegmentSettings=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.SegmentSettings} SegmentSettings instance + */ + SegmentSettings.create = function create(properties) { + return new SegmentSettings(properties); + }; + + /** + * Encodes the specified SegmentSettings message. Does not implicitly {@link google.cloud.video.livestream.v1.SegmentSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {google.cloud.video.livestream.v1.ISegmentSettings} message SegmentSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segmentDuration != null && Object.hasOwnProperty.call(message, "segmentDuration")) + $root.google.protobuf.Duration.encode(message.segmentDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SegmentSettings message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.SegmentSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {google.cloud.video.livestream.v1.ISegmentSettings} message SegmentSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SegmentSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SegmentSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.SegmentSettings} SegmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.SegmentSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segmentDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SegmentSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.SegmentSettings} SegmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SegmentSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SegmentSettings message. + * @function verify + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SegmentSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segmentDuration != null && message.hasOwnProperty("segmentDuration")) { + var error = $root.google.protobuf.Duration.verify(message.segmentDuration); + if (error) + return "segmentDuration." + error; + } + return null; + }; + + /** + * Creates a SegmentSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.SegmentSettings} SegmentSettings + */ + SegmentSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.SegmentSettings) + return object; + var message = new $root.google.cloud.video.livestream.v1.SegmentSettings(); + if (object.segmentDuration != null) { + if (typeof object.segmentDuration !== "object") + throw TypeError(".google.cloud.video.livestream.v1.SegmentSettings.segmentDuration: object expected"); + message.segmentDuration = $root.google.protobuf.Duration.fromObject(object.segmentDuration); + } + return message; + }; + + /** + * Creates a plain object from a SegmentSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {google.cloud.video.livestream.v1.SegmentSettings} message SegmentSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SegmentSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.segmentDuration = null; + if (message.segmentDuration != null && message.hasOwnProperty("segmentDuration")) + object.segmentDuration = $root.google.protobuf.Duration.toObject(message.segmentDuration, options); + return object; + }; + + /** + * Converts this SegmentSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @instance + * @returns {Object.} JSON object + */ + SegmentSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SegmentSettings + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.SegmentSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SegmentSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.SegmentSettings"; + }; + + return SegmentSettings; + })(); + + v1.Input = (function() { + + /** + * Properties of an Input. + * @memberof google.cloud.video.livestream.v1 + * @interface IInput + * @property {string|null} [name] Input name + * @property {google.protobuf.ITimestamp|null} [createTime] Input createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Input updateTime + * @property {Object.|null} [labels] Input labels + * @property {google.cloud.video.livestream.v1.Input.Type|null} [type] Input type + * @property {google.cloud.video.livestream.v1.Input.Tier|null} [tier] Input tier + * @property {string|null} [uri] Input uri + * @property {google.cloud.video.livestream.v1.IPreprocessingConfig|null} [preprocessingConfig] Input preprocessingConfig + * @property {google.cloud.video.livestream.v1.Input.ISecurityRule|null} [securityRules] Input securityRules + * @property {google.cloud.video.livestream.v1.IInputStreamProperty|null} [inputStreamProperty] Input inputStreamProperty + */ + + /** + * Constructs a new Input. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an Input. + * @implements IInput + * @constructor + * @param {google.cloud.video.livestream.v1.IInput=} [properties] Properties to set + */ + function Input(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]]; + } + + /** + * Input name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.name = ""; + + /** + * Input createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.createTime = null; + + /** + * Input updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.updateTime = null; + + /** + * Input labels. + * @member {Object.} labels + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.labels = $util.emptyObject; + + /** + * Input type. + * @member {google.cloud.video.livestream.v1.Input.Type} type + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.type = 0; + + /** + * Input tier. + * @member {google.cloud.video.livestream.v1.Input.Tier} tier + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.tier = 0; + + /** + * Input uri. + * @member {string} uri + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.uri = ""; + + /** + * Input preprocessingConfig. + * @member {google.cloud.video.livestream.v1.IPreprocessingConfig|null|undefined} preprocessingConfig + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.preprocessingConfig = null; + + /** + * Input securityRules. + * @member {google.cloud.video.livestream.v1.Input.ISecurityRule|null|undefined} securityRules + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.securityRules = null; + + /** + * Input inputStreamProperty. + * @member {google.cloud.video.livestream.v1.IInputStreamProperty|null|undefined} inputStreamProperty + * @memberof google.cloud.video.livestream.v1.Input + * @instance + */ + Input.prototype.inputStreamProperty = null; + + /** + * Creates a new Input instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {google.cloud.video.livestream.v1.IInput=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Input} Input instance + */ + Input.create = function create(properties) { + return new Input(properties); + }; + + /** + * Encodes the specified Input message. Does not implicitly {@link google.cloud.video.livestream.v1.Input.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {google.cloud.video.livestream.v1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.uri); + if (message.preprocessingConfig != null && Object.hasOwnProperty.call(message, "preprocessingConfig")) + $root.google.cloud.video.livestream.v1.PreprocessingConfig.encode(message.preprocessingConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.securityRules != null && Object.hasOwnProperty.call(message, "securityRules")) + $root.google.cloud.video.livestream.v1.Input.SecurityRule.encode(message.securityRules, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.tier); + if (message.inputStreamProperty != null && Object.hasOwnProperty.call(message, "inputStreamProperty")) + $root.google.cloud.video.livestream.v1.InputStreamProperty.encode(message.inputStreamProperty, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Input.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {google.cloud.video.livestream.v1.IInput} message Input message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Input.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Input message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Input(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 14: { + message.tier = reader.int32(); + break; + } + case 6: { + message.uri = reader.string(); + break; + } + case 9: { + message.preprocessingConfig = $root.google.cloud.video.livestream.v1.PreprocessingConfig.decode(reader, reader.uint32()); + break; + } + case 12: { + message.securityRules = $root.google.cloud.video.livestream.v1.Input.SecurityRule.decode(reader, reader.uint32()); + break; + } + case 15: { + message.inputStreamProperty = $root.google.cloud.video.livestream.v1.InputStreamProperty.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Input message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Input} Input + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Input.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Input message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Input.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.preprocessingConfig != null && message.hasOwnProperty("preprocessingConfig")) { + var error = $root.google.cloud.video.livestream.v1.PreprocessingConfig.verify(message.preprocessingConfig); + if (error) + return "preprocessingConfig." + error; + } + if (message.securityRules != null && message.hasOwnProperty("securityRules")) { + var error = $root.google.cloud.video.livestream.v1.Input.SecurityRule.verify(message.securityRules); + if (error) + return "securityRules." + error; + } + if (message.inputStreamProperty != null && message.hasOwnProperty("inputStreamProperty")) { + var error = $root.google.cloud.video.livestream.v1.InputStreamProperty.verify(message.inputStreamProperty); + if (error) + return "inputStreamProperty." + error; + } + return null; + }; + + /** + * Creates an Input message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Input} Input + */ + Input.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Input) + return object; + var message = new $root.google.cloud.video.livestream.v1.Input(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Input.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Input.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Input.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "RTMP_PUSH": + case 1: + message.type = 1; + break; + case "SRT_PUSH": + case 2: + message.type = 2; + break; + } + switch (object.tier) { + default: + if (typeof object.tier === "number") { + message.tier = object.tier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "SD": + case 1: + message.tier = 1; + break; + case "HD": + case 2: + message.tier = 2; + break; + case "UHD": + case 3: + message.tier = 3; + break; + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.preprocessingConfig != null) { + if (typeof object.preprocessingConfig !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Input.preprocessingConfig: object expected"); + message.preprocessingConfig = $root.google.cloud.video.livestream.v1.PreprocessingConfig.fromObject(object.preprocessingConfig); + } + if (object.securityRules != null) { + if (typeof object.securityRules !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Input.securityRules: object expected"); + message.securityRules = $root.google.cloud.video.livestream.v1.Input.SecurityRule.fromObject(object.securityRules); + } + if (object.inputStreamProperty != null) { + if (typeof object.inputStreamProperty !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Input.inputStreamProperty: object expected"); + message.inputStreamProperty = $root.google.cloud.video.livestream.v1.InputStreamProperty.fromObject(object.inputStreamProperty); + } + return message; + }; + + /** + * Creates a plain object from an Input message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {google.cloud.video.livestream.v1.Input} message Input + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Input.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.uri = ""; + object.preprocessingConfig = null; + object.securityRules = null; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.inputStreamProperty = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.video.livestream.v1.Input.Type[message.type] === undefined ? message.type : $root.google.cloud.video.livestream.v1.Input.Type[message.type] : message.type; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.preprocessingConfig != null && message.hasOwnProperty("preprocessingConfig")) + object.preprocessingConfig = $root.google.cloud.video.livestream.v1.PreprocessingConfig.toObject(message.preprocessingConfig, options); + if (message.securityRules != null && message.hasOwnProperty("securityRules")) + object.securityRules = $root.google.cloud.video.livestream.v1.Input.SecurityRule.toObject(message.securityRules, options); + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.video.livestream.v1.Input.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.video.livestream.v1.Input.Tier[message.tier] : message.tier; + if (message.inputStreamProperty != null && message.hasOwnProperty("inputStreamProperty")) + object.inputStreamProperty = $root.google.cloud.video.livestream.v1.InputStreamProperty.toObject(message.inputStreamProperty, options); + return object; + }; + + /** + * Converts this Input to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Input + * @instance + * @returns {Object.} JSON object + */ + Input.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Input + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Input + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Input.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Input"; + }; + + /** + * Type enum. + * @name google.cloud.video.livestream.v1.Input.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} RTMP_PUSH=1 RTMP_PUSH value + * @property {number} SRT_PUSH=2 SRT_PUSH value + */ + Input.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RTMP_PUSH"] = 1; + values[valuesById[2] = "SRT_PUSH"] = 2; + return values; + })(); + + /** + * Tier enum. + * @name google.cloud.video.livestream.v1.Input.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} SD=1 SD value + * @property {number} HD=2 HD value + * @property {number} UHD=3 UHD value + */ + Input.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SD"] = 1; + values[valuesById[2] = "HD"] = 2; + values[valuesById[3] = "UHD"] = 3; + return values; + })(); + + Input.SecurityRule = (function() { + + /** + * Properties of a SecurityRule. + * @memberof google.cloud.video.livestream.v1.Input + * @interface ISecurityRule + * @property {Array.|null} [ipRanges] SecurityRule ipRanges + */ + + /** + * Constructs a new SecurityRule. + * @memberof google.cloud.video.livestream.v1.Input + * @classdesc Represents a SecurityRule. + * @implements ISecurityRule + * @constructor + * @param {google.cloud.video.livestream.v1.Input.ISecurityRule=} [properties] Properties to set + */ + function SecurityRule(properties) { + this.ipRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityRule ipRanges. + * @member {Array.} ipRanges + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @instance + */ + SecurityRule.prototype.ipRanges = $util.emptyArray; + + /** + * Creates a new SecurityRule instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {google.cloud.video.livestream.v1.Input.ISecurityRule=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Input.SecurityRule} SecurityRule instance + */ + SecurityRule.create = function create(properties) { + return new SecurityRule(properties); + }; + + /** + * Encodes the specified SecurityRule message. Does not implicitly {@link google.cloud.video.livestream.v1.Input.SecurityRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {google.cloud.video.livestream.v1.Input.ISecurityRule} message SecurityRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipRanges != null && message.ipRanges.length) + for (var i = 0; i < message.ipRanges.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipRanges[i]); + return writer; + }; + + /** + * Encodes the specified SecurityRule message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Input.SecurityRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {google.cloud.video.livestream.v1.Input.ISecurityRule} message SecurityRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Input.SecurityRule} SecurityRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Input.SecurityRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ipRanges && message.ipRanges.length)) + message.ipRanges = []; + message.ipRanges.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Input.SecurityRule} SecurityRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityRule message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipRanges != null && message.hasOwnProperty("ipRanges")) { + if (!Array.isArray(message.ipRanges)) + return "ipRanges: array expected"; + for (var i = 0; i < message.ipRanges.length; ++i) + if (!$util.isString(message.ipRanges[i])) + return "ipRanges: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Input.SecurityRule} SecurityRule + */ + SecurityRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Input.SecurityRule) + return object; + var message = new $root.google.cloud.video.livestream.v1.Input.SecurityRule(); + if (object.ipRanges) { + if (!Array.isArray(object.ipRanges)) + throw TypeError(".google.cloud.video.livestream.v1.Input.SecurityRule.ipRanges: array expected"); + message.ipRanges = []; + for (var i = 0; i < object.ipRanges.length; ++i) + message.ipRanges[i] = String(object.ipRanges[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {google.cloud.video.livestream.v1.Input.SecurityRule} message SecurityRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ipRanges = []; + if (message.ipRanges && message.ipRanges.length) { + object.ipRanges = []; + for (var j = 0; j < message.ipRanges.length; ++j) + object.ipRanges[j] = message.ipRanges[j]; + } + return object; + }; + + /** + * Converts this SecurityRule to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @instance + * @returns {Object.} JSON object + */ + SecurityRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityRule + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Input.SecurityRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Input.SecurityRule"; + }; + + return SecurityRule; + })(); + + return Input; + })(); + + v1.Channel = (function() { + + /** + * Properties of a Channel. + * @memberof google.cloud.video.livestream.v1 + * @interface IChannel + * @property {string|null} [name] Channel name + * @property {google.protobuf.ITimestamp|null} [createTime] Channel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Channel updateTime + * @property {Object.|null} [labels] Channel labels + * @property {Array.|null} [inputAttachments] Channel inputAttachments + * @property {string|null} [activeInput] Channel activeInput + * @property {google.cloud.video.livestream.v1.Channel.IOutput|null} [output] Channel output + * @property {Array.|null} [elementaryStreams] Channel elementaryStreams + * @property {Array.|null} [muxStreams] Channel muxStreams + * @property {Array.|null} [manifests] Channel manifests + * @property {Array.|null} [spriteSheets] Channel spriteSheets + * @property {google.cloud.video.livestream.v1.Channel.StreamingState|null} [streamingState] Channel streamingState + * @property {google.rpc.IStatus|null} [streamingError] Channel streamingError + * @property {google.cloud.video.livestream.v1.ILogConfig|null} [logConfig] Channel logConfig + */ + + /** + * Constructs a new Channel. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a Channel. + * @implements IChannel + * @constructor + * @param {google.cloud.video.livestream.v1.IChannel=} [properties] Properties to set + */ + function Channel(properties) { + this.labels = {}; + this.inputAttachments = []; + this.elementaryStreams = []; + this.muxStreams = []; + this.manifests = []; + this.spriteSheets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Channel name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.name = ""; + + /** + * Channel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.createTime = null; + + /** + * Channel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.updateTime = null; + + /** + * Channel labels. + * @member {Object.} labels + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.labels = $util.emptyObject; + + /** + * Channel inputAttachments. + * @member {Array.} inputAttachments + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.inputAttachments = $util.emptyArray; + + /** + * Channel activeInput. + * @member {string} activeInput + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.activeInput = ""; + + /** + * Channel output. + * @member {google.cloud.video.livestream.v1.Channel.IOutput|null|undefined} output + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.output = null; + + /** + * Channel elementaryStreams. + * @member {Array.} elementaryStreams + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.elementaryStreams = $util.emptyArray; + + /** + * Channel muxStreams. + * @member {Array.} muxStreams + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.muxStreams = $util.emptyArray; + + /** + * Channel manifests. + * @member {Array.} manifests + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.manifests = $util.emptyArray; + + /** + * Channel spriteSheets. + * @member {Array.} spriteSheets + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.spriteSheets = $util.emptyArray; + + /** + * Channel streamingState. + * @member {google.cloud.video.livestream.v1.Channel.StreamingState} streamingState + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.streamingState = 0; + + /** + * Channel streamingError. + * @member {google.rpc.IStatus|null|undefined} streamingError + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.streamingError = null; + + /** + * Channel logConfig. + * @member {google.cloud.video.livestream.v1.ILogConfig|null|undefined} logConfig + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + */ + Channel.prototype.logConfig = null; + + /** + * Creates a new Channel instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {google.cloud.video.livestream.v1.IChannel=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {google.cloud.video.livestream.v1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.activeInput != null && Object.hasOwnProperty.call(message, "activeInput")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.activeInput); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + $root.google.cloud.video.livestream.v1.Channel.Output.encode(message.output, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.elementaryStreams != null && message.elementaryStreams.length) + for (var i = 0; i < message.elementaryStreams.length; ++i) + $root.google.cloud.video.livestream.v1.ElementaryStream.encode(message.elementaryStreams[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.muxStreams != null && message.muxStreams.length) + for (var i = 0; i < message.muxStreams.length; ++i) + $root.google.cloud.video.livestream.v1.MuxStream.encode(message.muxStreams[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.manifests != null && message.manifests.length) + for (var i = 0; i < message.manifests.length; ++i) + $root.google.cloud.video.livestream.v1.Manifest.encode(message.manifests[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.spriteSheets != null && message.spriteSheets.length) + for (var i = 0; i < message.spriteSheets.length; ++i) + $root.google.cloud.video.livestream.v1.SpriteSheet.encode(message.spriteSheets[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.streamingState != null && Object.hasOwnProperty.call(message, "streamingState")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.streamingState); + if (message.inputAttachments != null && message.inputAttachments.length) + for (var i = 0; i < message.inputAttachments.length; ++i) + $root.google.cloud.video.livestream.v1.InputAttachment.encode(message.inputAttachments[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.streamingError != null && Object.hasOwnProperty.call(message, "streamingError")) + $root.google.rpc.Status.encode(message.streamingError, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) + $root.google.cloud.video.livestream.v1.LogConfig.encode(message.logConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {google.cloud.video.livestream.v1.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Channel(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 16: { + if (!(message.inputAttachments && message.inputAttachments.length)) + message.inputAttachments = []; + message.inputAttachments.push($root.google.cloud.video.livestream.v1.InputAttachment.decode(reader, reader.uint32())); + break; + } + case 6: { + message.activeInput = reader.string(); + break; + } + case 9: { + message.output = $root.google.cloud.video.livestream.v1.Channel.Output.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.elementaryStreams && message.elementaryStreams.length)) + message.elementaryStreams = []; + message.elementaryStreams.push($root.google.cloud.video.livestream.v1.ElementaryStream.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.muxStreams && message.muxStreams.length)) + message.muxStreams = []; + message.muxStreams.push($root.google.cloud.video.livestream.v1.MuxStream.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.manifests && message.manifests.length)) + message.manifests = []; + message.manifests.push($root.google.cloud.video.livestream.v1.Manifest.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.spriteSheets && message.spriteSheets.length)) + message.spriteSheets = []; + message.spriteSheets.push($root.google.cloud.video.livestream.v1.SpriteSheet.decode(reader, reader.uint32())); + break; + } + case 14: { + message.streamingState = reader.int32(); + break; + } + case 18: { + message.streamingError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 19: { + message.logConfig = $root.google.cloud.video.livestream.v1.LogConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Channel message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Channel.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.inputAttachments != null && message.hasOwnProperty("inputAttachments")) { + if (!Array.isArray(message.inputAttachments)) + return "inputAttachments: array expected"; + for (var i = 0; i < message.inputAttachments.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.InputAttachment.verify(message.inputAttachments[i]); + if (error) + return "inputAttachments." + error; + } + } + if (message.activeInput != null && message.hasOwnProperty("activeInput")) + if (!$util.isString(message.activeInput)) + return "activeInput: string expected"; + if (message.output != null && message.hasOwnProperty("output")) { + var error = $root.google.cloud.video.livestream.v1.Channel.Output.verify(message.output); + if (error) + return "output." + error; + } + if (message.elementaryStreams != null && message.hasOwnProperty("elementaryStreams")) { + if (!Array.isArray(message.elementaryStreams)) + return "elementaryStreams: array expected"; + for (var i = 0; i < message.elementaryStreams.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.ElementaryStream.verify(message.elementaryStreams[i]); + if (error) + return "elementaryStreams." + error; + } + } + if (message.muxStreams != null && message.hasOwnProperty("muxStreams")) { + if (!Array.isArray(message.muxStreams)) + return "muxStreams: array expected"; + for (var i = 0; i < message.muxStreams.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.MuxStream.verify(message.muxStreams[i]); + if (error) + return "muxStreams." + error; + } + } + if (message.manifests != null && message.hasOwnProperty("manifests")) { + if (!Array.isArray(message.manifests)) + return "manifests: array expected"; + for (var i = 0; i < message.manifests.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Manifest.verify(message.manifests[i]); + if (error) + return "manifests." + error; + } + } + if (message.spriteSheets != null && message.hasOwnProperty("spriteSheets")) { + if (!Array.isArray(message.spriteSheets)) + return "spriteSheets: array expected"; + for (var i = 0; i < message.spriteSheets.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.SpriteSheet.verify(message.spriteSheets[i]); + if (error) + return "spriteSheets." + error; + } + } + if (message.streamingState != null && message.hasOwnProperty("streamingState")) + switch (message.streamingState) { + default: + return "streamingState: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.streamingError != null && message.hasOwnProperty("streamingError")) { + var error = $root.google.rpc.Status.verify(message.streamingError); + if (error) + return "streamingError." + error; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + var error = $root.google.cloud.video.livestream.v1.LogConfig.verify(message.logConfig); + if (error) + return "logConfig." + error; + } + return null; + }; + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Channel} Channel + */ + Channel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Channel) + return object; + var message = new $root.google.cloud.video.livestream.v1.Channel(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.inputAttachments) { + if (!Array.isArray(object.inputAttachments)) + throw TypeError(".google.cloud.video.livestream.v1.Channel.inputAttachments: array expected"); + message.inputAttachments = []; + for (var i = 0; i < object.inputAttachments.length; ++i) { + if (typeof object.inputAttachments[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.inputAttachments: object expected"); + message.inputAttachments[i] = $root.google.cloud.video.livestream.v1.InputAttachment.fromObject(object.inputAttachments[i]); + } + } + if (object.activeInput != null) + message.activeInput = String(object.activeInput); + if (object.output != null) { + if (typeof object.output !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.output: object expected"); + message.output = $root.google.cloud.video.livestream.v1.Channel.Output.fromObject(object.output); + } + if (object.elementaryStreams) { + if (!Array.isArray(object.elementaryStreams)) + throw TypeError(".google.cloud.video.livestream.v1.Channel.elementaryStreams: array expected"); + message.elementaryStreams = []; + for (var i = 0; i < object.elementaryStreams.length; ++i) { + if (typeof object.elementaryStreams[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.elementaryStreams: object expected"); + message.elementaryStreams[i] = $root.google.cloud.video.livestream.v1.ElementaryStream.fromObject(object.elementaryStreams[i]); + } + } + if (object.muxStreams) { + if (!Array.isArray(object.muxStreams)) + throw TypeError(".google.cloud.video.livestream.v1.Channel.muxStreams: array expected"); + message.muxStreams = []; + for (var i = 0; i < object.muxStreams.length; ++i) { + if (typeof object.muxStreams[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.muxStreams: object expected"); + message.muxStreams[i] = $root.google.cloud.video.livestream.v1.MuxStream.fromObject(object.muxStreams[i]); + } + } + if (object.manifests) { + if (!Array.isArray(object.manifests)) + throw TypeError(".google.cloud.video.livestream.v1.Channel.manifests: array expected"); + message.manifests = []; + for (var i = 0; i < object.manifests.length; ++i) { + if (typeof object.manifests[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.manifests: object expected"); + message.manifests[i] = $root.google.cloud.video.livestream.v1.Manifest.fromObject(object.manifests[i]); + } + } + if (object.spriteSheets) { + if (!Array.isArray(object.spriteSheets)) + throw TypeError(".google.cloud.video.livestream.v1.Channel.spriteSheets: array expected"); + message.spriteSheets = []; + for (var i = 0; i < object.spriteSheets.length; ++i) { + if (typeof object.spriteSheets[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.spriteSheets: object expected"); + message.spriteSheets[i] = $root.google.cloud.video.livestream.v1.SpriteSheet.fromObject(object.spriteSheets[i]); + } + } + switch (object.streamingState) { + default: + if (typeof object.streamingState === "number") { + message.streamingState = object.streamingState; + break; + } + break; + case "STREAMING_STATE_UNSPECIFIED": + case 0: + message.streamingState = 0; + break; + case "STREAMING": + case 1: + message.streamingState = 1; + break; + case "AWAITING_INPUT": + case 2: + message.streamingState = 2; + break; + case "STREAMING_ERROR": + case 4: + message.streamingState = 4; + break; + case "STREAMING_NO_INPUT": + case 5: + message.streamingState = 5; + break; + case "STOPPED": + case 6: + message.streamingState = 6; + break; + case "STARTING": + case 7: + message.streamingState = 7; + break; + case "STOPPING": + case 8: + message.streamingState = 8; + break; + } + if (object.streamingError != null) { + if (typeof object.streamingError !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.streamingError: object expected"); + message.streamingError = $root.google.rpc.Status.fromObject(object.streamingError); + } + if (object.logConfig != null) { + if (typeof object.logConfig !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Channel.logConfig: object expected"); + message.logConfig = $root.google.cloud.video.livestream.v1.LogConfig.fromObject(object.logConfig); + } + return message; + }; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {google.cloud.video.livestream.v1.Channel} message Channel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Channel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.elementaryStreams = []; + object.muxStreams = []; + object.manifests = []; + object.spriteSheets = []; + object.inputAttachments = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.activeInput = ""; + object.output = null; + object.streamingState = options.enums === String ? "STREAMING_STATE_UNSPECIFIED" : 0; + object.streamingError = null; + object.logConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.activeInput != null && message.hasOwnProperty("activeInput")) + object.activeInput = message.activeInput; + if (message.output != null && message.hasOwnProperty("output")) + object.output = $root.google.cloud.video.livestream.v1.Channel.Output.toObject(message.output, options); + if (message.elementaryStreams && message.elementaryStreams.length) { + object.elementaryStreams = []; + for (var j = 0; j < message.elementaryStreams.length; ++j) + object.elementaryStreams[j] = $root.google.cloud.video.livestream.v1.ElementaryStream.toObject(message.elementaryStreams[j], options); + } + if (message.muxStreams && message.muxStreams.length) { + object.muxStreams = []; + for (var j = 0; j < message.muxStreams.length; ++j) + object.muxStreams[j] = $root.google.cloud.video.livestream.v1.MuxStream.toObject(message.muxStreams[j], options); + } + if (message.manifests && message.manifests.length) { + object.manifests = []; + for (var j = 0; j < message.manifests.length; ++j) + object.manifests[j] = $root.google.cloud.video.livestream.v1.Manifest.toObject(message.manifests[j], options); + } + if (message.spriteSheets && message.spriteSheets.length) { + object.spriteSheets = []; + for (var j = 0; j < message.spriteSheets.length; ++j) + object.spriteSheets[j] = $root.google.cloud.video.livestream.v1.SpriteSheet.toObject(message.spriteSheets[j], options); + } + if (message.streamingState != null && message.hasOwnProperty("streamingState")) + object.streamingState = options.enums === String ? $root.google.cloud.video.livestream.v1.Channel.StreamingState[message.streamingState] === undefined ? message.streamingState : $root.google.cloud.video.livestream.v1.Channel.StreamingState[message.streamingState] : message.streamingState; + if (message.inputAttachments && message.inputAttachments.length) { + object.inputAttachments = []; + for (var j = 0; j < message.inputAttachments.length; ++j) + object.inputAttachments[j] = $root.google.cloud.video.livestream.v1.InputAttachment.toObject(message.inputAttachments[j], options); + } + if (message.streamingError != null && message.hasOwnProperty("streamingError")) + object.streamingError = $root.google.rpc.Status.toObject(message.streamingError, options); + if (message.logConfig != null && message.hasOwnProperty("logConfig")) + object.logConfig = $root.google.cloud.video.livestream.v1.LogConfig.toObject(message.logConfig, options); + return object; + }; + + /** + * Converts this Channel to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Channel + * @instance + * @returns {Object.} JSON object + */ + Channel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Channel + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Channel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Channel"; + }; + + Channel.Output = (function() { + + /** + * Properties of an Output. + * @memberof google.cloud.video.livestream.v1.Channel + * @interface IOutput + * @property {string|null} [uri] Output uri + */ + + /** + * Constructs a new Output. + * @memberof google.cloud.video.livestream.v1.Channel + * @classdesc Represents an Output. + * @implements IOutput + * @constructor + * @param {google.cloud.video.livestream.v1.Channel.IOutput=} [properties] Properties to set + */ + function Output(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Output uri. + * @member {string} uri + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @instance + */ + Output.prototype.uri = ""; + + /** + * Creates a new Output instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {google.cloud.video.livestream.v1.Channel.IOutput=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Channel.Output} Output instance + */ + Output.create = function create(properties) { + return new Output(properties); + }; + + /** + * Encodes the specified Output message. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.Output.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {google.cloud.video.livestream.v1.Channel.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified Output message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Channel.Output.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {google.cloud.video.livestream.v1.Channel.IOutput} message Output message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Output.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Output message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Channel.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Channel.Output(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Output message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Channel.Output} Output + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Output.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Output message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Output.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates an Output message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Channel.Output} Output + */ + Output.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Channel.Output) + return object; + var message = new $root.google.cloud.video.livestream.v1.Channel.Output(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from an Output message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {google.cloud.video.livestream.v1.Channel.Output} message Output + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Output.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this Output to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @instance + * @returns {Object.} JSON object + */ + Output.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Output + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Channel.Output + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Output.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Channel.Output"; + }; + + return Output; + })(); + + /** + * StreamingState enum. + * @name google.cloud.video.livestream.v1.Channel.StreamingState + * @enum {number} + * @property {number} STREAMING_STATE_UNSPECIFIED=0 STREAMING_STATE_UNSPECIFIED value + * @property {number} STREAMING=1 STREAMING value + * @property {number} AWAITING_INPUT=2 AWAITING_INPUT value + * @property {number} STREAMING_ERROR=4 STREAMING_ERROR value + * @property {number} STREAMING_NO_INPUT=5 STREAMING_NO_INPUT value + * @property {number} STOPPED=6 STOPPED value + * @property {number} STARTING=7 STARTING value + * @property {number} STOPPING=8 STOPPING value + */ + Channel.StreamingState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STREAMING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STREAMING"] = 1; + values[valuesById[2] = "AWAITING_INPUT"] = 2; + values[valuesById[4] = "STREAMING_ERROR"] = 4; + values[valuesById[5] = "STREAMING_NO_INPUT"] = 5; + values[valuesById[6] = "STOPPED"] = 6; + values[valuesById[7] = "STARTING"] = 7; + values[valuesById[8] = "STOPPING"] = 8; + return values; + })(); + + return Channel; + })(); + + v1.LogConfig = (function() { + + /** + * Properties of a LogConfig. + * @memberof google.cloud.video.livestream.v1 + * @interface ILogConfig + * @property {google.cloud.video.livestream.v1.LogConfig.LogSeverity|null} [logSeverity] LogConfig logSeverity + */ + + /** + * Constructs a new LogConfig. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a LogConfig. + * @implements ILogConfig + * @constructor + * @param {google.cloud.video.livestream.v1.ILogConfig=} [properties] Properties to set + */ + function LogConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogConfig logSeverity. + * @member {google.cloud.video.livestream.v1.LogConfig.LogSeverity} logSeverity + * @memberof google.cloud.video.livestream.v1.LogConfig + * @instance + */ + LogConfig.prototype.logSeverity = 0; + + /** + * Creates a new LogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {google.cloud.video.livestream.v1.ILogConfig=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.LogConfig} LogConfig instance + */ + LogConfig.create = function create(properties) { + return new LogConfig(properties); + }; + + /** + * Encodes the specified LogConfig message. Does not implicitly {@link google.cloud.video.livestream.v1.LogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {google.cloud.video.livestream.v1.ILogConfig} message LogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logSeverity != null && Object.hasOwnProperty.call(message, "logSeverity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logSeverity); + return writer; + }; + + /** + * Encodes the specified LogConfig message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.LogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {google.cloud.video.livestream.v1.ILogConfig} message LogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.LogConfig} LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.LogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logSeverity = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.LogConfig} LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogConfig message. + * @function verify + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logSeverity != null && message.hasOwnProperty("logSeverity")) + switch (message.logSeverity) { + default: + return "logSeverity: enum value expected"; + case 0: + case 1: + case 100: + case 200: + case 400: + case 500: + break; + } + return null; + }; + + /** + * Creates a LogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.LogConfig} LogConfig + */ + LogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.LogConfig) + return object; + var message = new $root.google.cloud.video.livestream.v1.LogConfig(); + switch (object.logSeverity) { + default: + if (typeof object.logSeverity === "number") { + message.logSeverity = object.logSeverity; + break; + } + break; + case "LOG_SEVERITY_UNSPECIFIED": + case 0: + message.logSeverity = 0; + break; + case "OFF": + case 1: + message.logSeverity = 1; + break; + case "DEBUG": + case 100: + message.logSeverity = 100; + break; + case "INFO": + case 200: + message.logSeverity = 200; + break; + case "WARNING": + case 400: + message.logSeverity = 400; + break; + case "ERROR": + case 500: + message.logSeverity = 500; + break; + } + return message; + }; + + /** + * Creates a plain object from a LogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {google.cloud.video.livestream.v1.LogConfig} message LogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.logSeverity = options.enums === String ? "LOG_SEVERITY_UNSPECIFIED" : 0; + if (message.logSeverity != null && message.hasOwnProperty("logSeverity")) + object.logSeverity = options.enums === String ? $root.google.cloud.video.livestream.v1.LogConfig.LogSeverity[message.logSeverity] === undefined ? message.logSeverity : $root.google.cloud.video.livestream.v1.LogConfig.LogSeverity[message.logSeverity] : message.logSeverity; + return object; + }; + + /** + * Converts this LogConfig to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.LogConfig + * @instance + * @returns {Object.} JSON object + */ + LogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogConfig + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.LogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.LogConfig"; + }; + + /** + * LogSeverity enum. + * @name google.cloud.video.livestream.v1.LogConfig.LogSeverity + * @enum {number} + * @property {number} LOG_SEVERITY_UNSPECIFIED=0 LOG_SEVERITY_UNSPECIFIED value + * @property {number} OFF=1 OFF value + * @property {number} DEBUG=100 DEBUG value + * @property {number} INFO=200 INFO value + * @property {number} WARNING=400 WARNING value + * @property {number} ERROR=500 ERROR value + */ + LogConfig.LogSeverity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "OFF"] = 1; + values[valuesById[100] = "DEBUG"] = 100; + values[valuesById[200] = "INFO"] = 200; + values[valuesById[400] = "WARNING"] = 400; + values[valuesById[500] = "ERROR"] = 500; + return values; + })(); + + return LogConfig; + })(); + + v1.InputStreamProperty = (function() { + + /** + * Properties of an InputStreamProperty. + * @memberof google.cloud.video.livestream.v1 + * @interface IInputStreamProperty + * @property {google.protobuf.ITimestamp|null} [lastEstablishTime] InputStreamProperty lastEstablishTime + * @property {Array.|null} [videoStreams] InputStreamProperty videoStreams + * @property {Array.|null} [audioStreams] InputStreamProperty audioStreams + */ + + /** + * Constructs a new InputStreamProperty. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an InputStreamProperty. + * @implements IInputStreamProperty + * @constructor + * @param {google.cloud.video.livestream.v1.IInputStreamProperty=} [properties] Properties to set + */ + function InputStreamProperty(properties) { + this.videoStreams = []; + this.audioStreams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputStreamProperty lastEstablishTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastEstablishTime + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @instance + */ + InputStreamProperty.prototype.lastEstablishTime = null; + + /** + * InputStreamProperty videoStreams. + * @member {Array.} videoStreams + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @instance + */ + InputStreamProperty.prototype.videoStreams = $util.emptyArray; + + /** + * InputStreamProperty audioStreams. + * @member {Array.} audioStreams + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @instance + */ + InputStreamProperty.prototype.audioStreams = $util.emptyArray; + + /** + * Creates a new InputStreamProperty instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IInputStreamProperty=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.InputStreamProperty} InputStreamProperty instance + */ + InputStreamProperty.create = function create(properties) { + return new InputStreamProperty(properties); + }; + + /** + * Encodes the specified InputStreamProperty message. Does not implicitly {@link google.cloud.video.livestream.v1.InputStreamProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IInputStreamProperty} message InputStreamProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputStreamProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastEstablishTime != null && Object.hasOwnProperty.call(message, "lastEstablishTime")) + $root.google.protobuf.Timestamp.encode(message.lastEstablishTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.videoStreams != null && message.videoStreams.length) + for (var i = 0; i < message.videoStreams.length; ++i) + $root.google.cloud.video.livestream.v1.VideoStreamProperty.encode(message.videoStreams[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.audioStreams != null && message.audioStreams.length) + for (var i = 0; i < message.audioStreams.length; ++i) + $root.google.cloud.video.livestream.v1.AudioStreamProperty.encode(message.audioStreams[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputStreamProperty message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputStreamProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IInputStreamProperty} message InputStreamProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputStreamProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputStreamProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.InputStreamProperty} InputStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputStreamProperty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.InputStreamProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastEstablishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.videoStreams && message.videoStreams.length)) + message.videoStreams = []; + message.videoStreams.push($root.google.cloud.video.livestream.v1.VideoStreamProperty.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.audioStreams && message.audioStreams.length)) + message.audioStreams = []; + message.audioStreams.push($root.google.cloud.video.livestream.v1.AudioStreamProperty.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputStreamProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.InputStreamProperty} InputStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputStreamProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputStreamProperty message. + * @function verify + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputStreamProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastEstablishTime != null && message.hasOwnProperty("lastEstablishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastEstablishTime); + if (error) + return "lastEstablishTime." + error; + } + if (message.videoStreams != null && message.hasOwnProperty("videoStreams")) { + if (!Array.isArray(message.videoStreams)) + return "videoStreams: array expected"; + for (var i = 0; i < message.videoStreams.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.VideoStreamProperty.verify(message.videoStreams[i]); + if (error) + return "videoStreams." + error; + } + } + if (message.audioStreams != null && message.hasOwnProperty("audioStreams")) { + if (!Array.isArray(message.audioStreams)) + return "audioStreams: array expected"; + for (var i = 0; i < message.audioStreams.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.AudioStreamProperty.verify(message.audioStreams[i]); + if (error) + return "audioStreams." + error; + } + } + return null; + }; + + /** + * Creates an InputStreamProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.InputStreamProperty} InputStreamProperty + */ + InputStreamProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.InputStreamProperty) + return object; + var message = new $root.google.cloud.video.livestream.v1.InputStreamProperty(); + if (object.lastEstablishTime != null) { + if (typeof object.lastEstablishTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.InputStreamProperty.lastEstablishTime: object expected"); + message.lastEstablishTime = $root.google.protobuf.Timestamp.fromObject(object.lastEstablishTime); + } + if (object.videoStreams) { + if (!Array.isArray(object.videoStreams)) + throw TypeError(".google.cloud.video.livestream.v1.InputStreamProperty.videoStreams: array expected"); + message.videoStreams = []; + for (var i = 0; i < object.videoStreams.length; ++i) { + if (typeof object.videoStreams[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.InputStreamProperty.videoStreams: object expected"); + message.videoStreams[i] = $root.google.cloud.video.livestream.v1.VideoStreamProperty.fromObject(object.videoStreams[i]); + } + } + if (object.audioStreams) { + if (!Array.isArray(object.audioStreams)) + throw TypeError(".google.cloud.video.livestream.v1.InputStreamProperty.audioStreams: array expected"); + message.audioStreams = []; + for (var i = 0; i < object.audioStreams.length; ++i) { + if (typeof object.audioStreams[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.InputStreamProperty.audioStreams: object expected"); + message.audioStreams[i] = $root.google.cloud.video.livestream.v1.AudioStreamProperty.fromObject(object.audioStreams[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InputStreamProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.InputStreamProperty} message InputStreamProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputStreamProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.videoStreams = []; + object.audioStreams = []; + } + if (options.defaults) + object.lastEstablishTime = null; + if (message.lastEstablishTime != null && message.hasOwnProperty("lastEstablishTime")) + object.lastEstablishTime = $root.google.protobuf.Timestamp.toObject(message.lastEstablishTime, options); + if (message.videoStreams && message.videoStreams.length) { + object.videoStreams = []; + for (var j = 0; j < message.videoStreams.length; ++j) + object.videoStreams[j] = $root.google.cloud.video.livestream.v1.VideoStreamProperty.toObject(message.videoStreams[j], options); + } + if (message.audioStreams && message.audioStreams.length) { + object.audioStreams = []; + for (var j = 0; j < message.audioStreams.length; ++j) + object.audioStreams[j] = $root.google.cloud.video.livestream.v1.AudioStreamProperty.toObject(message.audioStreams[j], options); + } + return object; + }; + + /** + * Converts this InputStreamProperty to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @instance + * @returns {Object.} JSON object + */ + InputStreamProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputStreamProperty + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.InputStreamProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputStreamProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.InputStreamProperty"; + }; + + return InputStreamProperty; + })(); + + v1.VideoStreamProperty = (function() { + + /** + * Properties of a VideoStreamProperty. + * @memberof google.cloud.video.livestream.v1 + * @interface IVideoStreamProperty + * @property {number|null} [index] VideoStreamProperty index + * @property {google.cloud.video.livestream.v1.IVideoFormat|null} [videoFormat] VideoStreamProperty videoFormat + */ + + /** + * Constructs a new VideoStreamProperty. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a VideoStreamProperty. + * @implements IVideoStreamProperty + * @constructor + * @param {google.cloud.video.livestream.v1.IVideoStreamProperty=} [properties] Properties to set + */ + function VideoStreamProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoStreamProperty index. + * @member {number} index + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @instance + */ + VideoStreamProperty.prototype.index = 0; + + /** + * VideoStreamProperty videoFormat. + * @member {google.cloud.video.livestream.v1.IVideoFormat|null|undefined} videoFormat + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @instance + */ + VideoStreamProperty.prototype.videoFormat = null; + + /** + * Creates a new VideoStreamProperty instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IVideoStreamProperty=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.VideoStreamProperty} VideoStreamProperty instance + */ + VideoStreamProperty.create = function create(properties) { + return new VideoStreamProperty(properties); + }; + + /** + * Encodes the specified VideoStreamProperty message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStreamProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IVideoStreamProperty} message VideoStreamProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoStreamProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); + if (message.videoFormat != null && Object.hasOwnProperty.call(message, "videoFormat")) + $root.google.cloud.video.livestream.v1.VideoFormat.encode(message.videoFormat, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoStreamProperty message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoStreamProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IVideoStreamProperty} message VideoStreamProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoStreamProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoStreamProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.VideoStreamProperty} VideoStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoStreamProperty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.VideoStreamProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.index = reader.int32(); + break; + } + case 2: { + message.videoFormat = $root.google.cloud.video.livestream.v1.VideoFormat.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoStreamProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.VideoStreamProperty} VideoStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoStreamProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoStreamProperty message. + * @function verify + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoStreamProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.videoFormat != null && message.hasOwnProperty("videoFormat")) { + var error = $root.google.cloud.video.livestream.v1.VideoFormat.verify(message.videoFormat); + if (error) + return "videoFormat." + error; + } + return null; + }; + + /** + * Creates a VideoStreamProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.VideoStreamProperty} VideoStreamProperty + */ + VideoStreamProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.VideoStreamProperty) + return object; + var message = new $root.google.cloud.video.livestream.v1.VideoStreamProperty(); + if (object.index != null) + message.index = object.index | 0; + if (object.videoFormat != null) { + if (typeof object.videoFormat !== "object") + throw TypeError(".google.cloud.video.livestream.v1.VideoStreamProperty.videoFormat: object expected"); + message.videoFormat = $root.google.cloud.video.livestream.v1.VideoFormat.fromObject(object.videoFormat); + } + return message; + }; + + /** + * Creates a plain object from a VideoStreamProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.VideoStreamProperty} message VideoStreamProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoStreamProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + object.videoFormat = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.videoFormat != null && message.hasOwnProperty("videoFormat")) + object.videoFormat = $root.google.cloud.video.livestream.v1.VideoFormat.toObject(message.videoFormat, options); + return object; + }; + + /** + * Converts this VideoStreamProperty to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @instance + * @returns {Object.} JSON object + */ + VideoStreamProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoStreamProperty + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.VideoStreamProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoStreamProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.VideoStreamProperty"; + }; + + return VideoStreamProperty; + })(); + + v1.VideoFormat = (function() { + + /** + * Properties of a VideoFormat. + * @memberof google.cloud.video.livestream.v1 + * @interface IVideoFormat + * @property {string|null} [codec] VideoFormat codec + * @property {number|null} [widthPixels] VideoFormat widthPixels + * @property {number|null} [heightPixels] VideoFormat heightPixels + * @property {number|null} [frameRate] VideoFormat frameRate + */ + + /** + * Constructs a new VideoFormat. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a VideoFormat. + * @implements IVideoFormat + * @constructor + * @param {google.cloud.video.livestream.v1.IVideoFormat=} [properties] Properties to set + */ + function VideoFormat(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoFormat codec. + * @member {string} codec + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @instance + */ + VideoFormat.prototype.codec = ""; + + /** + * VideoFormat widthPixels. + * @member {number} widthPixels + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @instance + */ + VideoFormat.prototype.widthPixels = 0; + + /** + * VideoFormat heightPixels. + * @member {number} heightPixels + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @instance + */ + VideoFormat.prototype.heightPixels = 0; + + /** + * VideoFormat frameRate. + * @member {number} frameRate + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @instance + */ + VideoFormat.prototype.frameRate = 0; + + /** + * Creates a new VideoFormat instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {google.cloud.video.livestream.v1.IVideoFormat=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.VideoFormat} VideoFormat instance + */ + VideoFormat.create = function create(properties) { + return new VideoFormat(properties); + }; + + /** + * Encodes the specified VideoFormat message. Does not implicitly {@link google.cloud.video.livestream.v1.VideoFormat.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {google.cloud.video.livestream.v1.IVideoFormat} message VideoFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codec != null && Object.hasOwnProperty.call(message, "codec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.codec); + if (message.widthPixels != null && Object.hasOwnProperty.call(message, "widthPixels")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.widthPixels); + if (message.heightPixels != null && Object.hasOwnProperty.call(message, "heightPixels")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.heightPixels); + if (message.frameRate != null && Object.hasOwnProperty.call(message, "frameRate")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.frameRate); + return writer; + }; + + /** + * Encodes the specified VideoFormat message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.VideoFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {google.cloud.video.livestream.v1.IVideoFormat} message VideoFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoFormat message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.VideoFormat} VideoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoFormat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.VideoFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.codec = reader.string(); + break; + } + case 2: { + message.widthPixels = reader.int32(); + break; + } + case 3: { + message.heightPixels = reader.int32(); + break; + } + case 4: { + message.frameRate = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.VideoFormat} VideoFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoFormat message. + * @function verify + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.codec != null && message.hasOwnProperty("codec")) + if (!$util.isString(message.codec)) + return "codec: string expected"; + if (message.widthPixels != null && message.hasOwnProperty("widthPixels")) + if (!$util.isInteger(message.widthPixels)) + return "widthPixels: integer expected"; + if (message.heightPixels != null && message.hasOwnProperty("heightPixels")) + if (!$util.isInteger(message.heightPixels)) + return "heightPixels: integer expected"; + if (message.frameRate != null && message.hasOwnProperty("frameRate")) + if (typeof message.frameRate !== "number") + return "frameRate: number expected"; + return null; + }; + + /** + * Creates a VideoFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.VideoFormat} VideoFormat + */ + VideoFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.VideoFormat) + return object; + var message = new $root.google.cloud.video.livestream.v1.VideoFormat(); + if (object.codec != null) + message.codec = String(object.codec); + if (object.widthPixels != null) + message.widthPixels = object.widthPixels | 0; + if (object.heightPixels != null) + message.heightPixels = object.heightPixels | 0; + if (object.frameRate != null) + message.frameRate = Number(object.frameRate); + return message; + }; + + /** + * Creates a plain object from a VideoFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {google.cloud.video.livestream.v1.VideoFormat} message VideoFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoFormat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.codec = ""; + object.widthPixels = 0; + object.heightPixels = 0; + object.frameRate = 0; + } + if (message.codec != null && message.hasOwnProperty("codec")) + object.codec = message.codec; + if (message.widthPixels != null && message.hasOwnProperty("widthPixels")) + object.widthPixels = message.widthPixels; + if (message.heightPixels != null && message.hasOwnProperty("heightPixels")) + object.heightPixels = message.heightPixels; + if (message.frameRate != null && message.hasOwnProperty("frameRate")) + object.frameRate = options.json && !isFinite(message.frameRate) ? String(message.frameRate) : message.frameRate; + return object; + }; + + /** + * Converts this VideoFormat to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @instance + * @returns {Object.} JSON object + */ + VideoFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoFormat + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.VideoFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.VideoFormat"; + }; + + return VideoFormat; + })(); + + v1.AudioStreamProperty = (function() { + + /** + * Properties of an AudioStreamProperty. + * @memberof google.cloud.video.livestream.v1 + * @interface IAudioStreamProperty + * @property {number|null} [index] AudioStreamProperty index + * @property {google.cloud.video.livestream.v1.IAudioFormat|null} [audioFormat] AudioStreamProperty audioFormat + */ + + /** + * Constructs a new AudioStreamProperty. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an AudioStreamProperty. + * @implements IAudioStreamProperty + * @constructor + * @param {google.cloud.video.livestream.v1.IAudioStreamProperty=} [properties] Properties to set + */ + function AudioStreamProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioStreamProperty index. + * @member {number} index + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @instance + */ + AudioStreamProperty.prototype.index = 0; + + /** + * AudioStreamProperty audioFormat. + * @member {google.cloud.video.livestream.v1.IAudioFormat|null|undefined} audioFormat + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @instance + */ + AudioStreamProperty.prototype.audioFormat = null; + + /** + * Creates a new AudioStreamProperty instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IAudioStreamProperty=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.AudioStreamProperty} AudioStreamProperty instance + */ + AudioStreamProperty.create = function create(properties) { + return new AudioStreamProperty(properties); + }; + + /** + * Encodes the specified AudioStreamProperty message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStreamProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IAudioStreamProperty} message AudioStreamProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioStreamProperty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); + if (message.audioFormat != null && Object.hasOwnProperty.call(message, "audioFormat")) + $root.google.cloud.video.livestream.v1.AudioFormat.encode(message.audioFormat, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AudioStreamProperty message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioStreamProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.IAudioStreamProperty} message AudioStreamProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioStreamProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioStreamProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.AudioStreamProperty} AudioStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioStreamProperty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.AudioStreamProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.index = reader.int32(); + break; + } + case 2: { + message.audioFormat = $root.google.cloud.video.livestream.v1.AudioFormat.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioStreamProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.AudioStreamProperty} AudioStreamProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioStreamProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioStreamProperty message. + * @function verify + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioStreamProperty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) { + var error = $root.google.cloud.video.livestream.v1.AudioFormat.verify(message.audioFormat); + if (error) + return "audioFormat." + error; + } + return null; + }; + + /** + * Creates an AudioStreamProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.AudioStreamProperty} AudioStreamProperty + */ + AudioStreamProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.AudioStreamProperty) + return object; + var message = new $root.google.cloud.video.livestream.v1.AudioStreamProperty(); + if (object.index != null) + message.index = object.index | 0; + if (object.audioFormat != null) { + if (typeof object.audioFormat !== "object") + throw TypeError(".google.cloud.video.livestream.v1.AudioStreamProperty.audioFormat: object expected"); + message.audioFormat = $root.google.cloud.video.livestream.v1.AudioFormat.fromObject(object.audioFormat); + } + return message; + }; + + /** + * Creates a plain object from an AudioStreamProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {google.cloud.video.livestream.v1.AudioStreamProperty} message AudioStreamProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioStreamProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.index = 0; + object.audioFormat = null; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) + object.audioFormat = $root.google.cloud.video.livestream.v1.AudioFormat.toObject(message.audioFormat, options); + return object; + }; + + /** + * Converts this AudioStreamProperty to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @instance + * @returns {Object.} JSON object + */ + AudioStreamProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioStreamProperty + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.AudioStreamProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioStreamProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.AudioStreamProperty"; + }; + + return AudioStreamProperty; + })(); + + v1.AudioFormat = (function() { + + /** + * Properties of an AudioFormat. + * @memberof google.cloud.video.livestream.v1 + * @interface IAudioFormat + * @property {string|null} [codec] AudioFormat codec + * @property {number|null} [channelCount] AudioFormat channelCount + * @property {Array.|null} [channelLayout] AudioFormat channelLayout + */ + + /** + * Constructs a new AudioFormat. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an AudioFormat. + * @implements IAudioFormat + * @constructor + * @param {google.cloud.video.livestream.v1.IAudioFormat=} [properties] Properties to set + */ + function AudioFormat(properties) { + this.channelLayout = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioFormat codec. + * @member {string} codec + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @instance + */ + AudioFormat.prototype.codec = ""; + + /** + * AudioFormat channelCount. + * @member {number} channelCount + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @instance + */ + AudioFormat.prototype.channelCount = 0; + + /** + * AudioFormat channelLayout. + * @member {Array.} channelLayout + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @instance + */ + AudioFormat.prototype.channelLayout = $util.emptyArray; + + /** + * Creates a new AudioFormat instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {google.cloud.video.livestream.v1.IAudioFormat=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.AudioFormat} AudioFormat instance + */ + AudioFormat.create = function create(properties) { + return new AudioFormat(properties); + }; + + /** + * Encodes the specified AudioFormat message. Does not implicitly {@link google.cloud.video.livestream.v1.AudioFormat.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {google.cloud.video.livestream.v1.IAudioFormat} message AudioFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioFormat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.codec != null && Object.hasOwnProperty.call(message, "codec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.codec); + if (message.channelCount != null && Object.hasOwnProperty.call(message, "channelCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelCount); + if (message.channelLayout != null && message.channelLayout.length) + for (var i = 0; i < message.channelLayout.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.channelLayout[i]); + return writer; + }; + + /** + * Encodes the specified AudioFormat message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.AudioFormat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {google.cloud.video.livestream.v1.IAudioFormat} message AudioFormat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioFormat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioFormat message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.AudioFormat} AudioFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioFormat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.AudioFormat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.codec = reader.string(); + break; + } + case 2: { + message.channelCount = reader.int32(); + break; + } + case 3: { + if (!(message.channelLayout && message.channelLayout.length)) + message.channelLayout = []; + message.channelLayout.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioFormat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.AudioFormat} AudioFormat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioFormat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioFormat message. + * @function verify + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioFormat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.codec != null && message.hasOwnProperty("codec")) + if (!$util.isString(message.codec)) + return "codec: string expected"; + if (message.channelCount != null && message.hasOwnProperty("channelCount")) + if (!$util.isInteger(message.channelCount)) + return "channelCount: integer expected"; + if (message.channelLayout != null && message.hasOwnProperty("channelLayout")) { + if (!Array.isArray(message.channelLayout)) + return "channelLayout: array expected"; + for (var i = 0; i < message.channelLayout.length; ++i) + if (!$util.isString(message.channelLayout[i])) + return "channelLayout: string[] expected"; + } + return null; + }; + + /** + * Creates an AudioFormat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.AudioFormat} AudioFormat + */ + AudioFormat.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.AudioFormat) + return object; + var message = new $root.google.cloud.video.livestream.v1.AudioFormat(); + if (object.codec != null) + message.codec = String(object.codec); + if (object.channelCount != null) + message.channelCount = object.channelCount | 0; + if (object.channelLayout) { + if (!Array.isArray(object.channelLayout)) + throw TypeError(".google.cloud.video.livestream.v1.AudioFormat.channelLayout: array expected"); + message.channelLayout = []; + for (var i = 0; i < object.channelLayout.length; ++i) + message.channelLayout[i] = String(object.channelLayout[i]); + } + return message; + }; + + /** + * Creates a plain object from an AudioFormat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {google.cloud.video.livestream.v1.AudioFormat} message AudioFormat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioFormat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.channelLayout = []; + if (options.defaults) { + object.codec = ""; + object.channelCount = 0; + } + if (message.codec != null && message.hasOwnProperty("codec")) + object.codec = message.codec; + if (message.channelCount != null && message.hasOwnProperty("channelCount")) + object.channelCount = message.channelCount; + if (message.channelLayout && message.channelLayout.length) { + object.channelLayout = []; + for (var j = 0; j < message.channelLayout.length; ++j) + object.channelLayout[j] = message.channelLayout[j]; + } + return object; + }; + + /** + * Converts this AudioFormat to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @instance + * @returns {Object.} JSON object + */ + AudioFormat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AudioFormat + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.AudioFormat + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AudioFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.AudioFormat"; + }; + + return AudioFormat; + })(); + + v1.InputAttachment = (function() { + + /** + * Properties of an InputAttachment. + * @memberof google.cloud.video.livestream.v1 + * @interface IInputAttachment + * @property {string|null} [key] InputAttachment key + * @property {string|null} [input] InputAttachment input + * @property {google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover|null} [automaticFailover] InputAttachment automaticFailover + */ + + /** + * Constructs a new InputAttachment. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an InputAttachment. + * @implements IInputAttachment + * @constructor + * @param {google.cloud.video.livestream.v1.IInputAttachment=} [properties] Properties to set + */ + function InputAttachment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAttachment key. + * @member {string} key + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @instance + */ + InputAttachment.prototype.key = ""; + + /** + * InputAttachment input. + * @member {string} input + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @instance + */ + InputAttachment.prototype.input = ""; + + /** + * InputAttachment automaticFailover. + * @member {google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover|null|undefined} automaticFailover + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @instance + */ + InputAttachment.prototype.automaticFailover = null; + + /** + * Creates a new InputAttachment instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {google.cloud.video.livestream.v1.IInputAttachment=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.InputAttachment} InputAttachment instance + */ + InputAttachment.create = function create(properties) { + return new InputAttachment(properties); + }; + + /** + * Encodes the specified InputAttachment message. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {google.cloud.video.livestream.v1.IInputAttachment} message InputAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAttachment.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.input != null && Object.hasOwnProperty.call(message, "input")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); + if (message.automaticFailover != null && Object.hasOwnProperty.call(message, "automaticFailover")) + $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.encode(message.automaticFailover, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputAttachment message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {google.cloud.video.livestream.v1.IInputAttachment} message InputAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAttachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAttachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.InputAttachment} InputAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAttachment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.InputAttachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.input = reader.string(); + break; + } + case 3: { + message.automaticFailover = $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputAttachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.InputAttachment} InputAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAttachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAttachment message. + * @function verify + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAttachment.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.input != null && message.hasOwnProperty("input")) + if (!$util.isString(message.input)) + return "input: string expected"; + if (message.automaticFailover != null && message.hasOwnProperty("automaticFailover")) { + var error = $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.verify(message.automaticFailover); + if (error) + return "automaticFailover." + error; + } + return null; + }; + + /** + * Creates an InputAttachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.InputAttachment} InputAttachment + */ + InputAttachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.InputAttachment) + return object; + var message = new $root.google.cloud.video.livestream.v1.InputAttachment(); + if (object.key != null) + message.key = String(object.key); + if (object.input != null) + message.input = String(object.input); + if (object.automaticFailover != null) { + if (typeof object.automaticFailover !== "object") + throw TypeError(".google.cloud.video.livestream.v1.InputAttachment.automaticFailover: object expected"); + message.automaticFailover = $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.fromObject(object.automaticFailover); + } + return message; + }; + + /** + * Creates a plain object from an InputAttachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {google.cloud.video.livestream.v1.InputAttachment} message InputAttachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAttachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.input = ""; + object.automaticFailover = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.input != null && message.hasOwnProperty("input")) + object.input = message.input; + if (message.automaticFailover != null && message.hasOwnProperty("automaticFailover")) + object.automaticFailover = $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.toObject(message.automaticFailover, options); + return object; + }; + + /** + * Converts this InputAttachment to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @instance + * @returns {Object.} JSON object + */ + InputAttachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputAttachment + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputAttachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.InputAttachment"; + }; + + InputAttachment.AutomaticFailover = (function() { + + /** + * Properties of an AutomaticFailover. + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @interface IAutomaticFailover + * @property {Array.|null} [inputKeys] AutomaticFailover inputKeys + */ + + /** + * Constructs a new AutomaticFailover. + * @memberof google.cloud.video.livestream.v1.InputAttachment + * @classdesc Represents an AutomaticFailover. + * @implements IAutomaticFailover + * @constructor + * @param {google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover=} [properties] Properties to set + */ + function AutomaticFailover(properties) { + this.inputKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomaticFailover inputKeys. + * @member {Array.} inputKeys + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @instance + */ + AutomaticFailover.prototype.inputKeys = $util.emptyArray; + + /** + * Creates a new AutomaticFailover instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover} AutomaticFailover instance + */ + AutomaticFailover.create = function create(properties) { + return new AutomaticFailover(properties); + }; + + /** + * Encodes the specified AutomaticFailover message. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover} message AutomaticFailover message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticFailover.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputKeys != null && message.inputKeys.length) + for (var i = 0; i < message.inputKeys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputKeys[i]); + return writer; + }; + + /** + * Encodes the specified AutomaticFailover message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {google.cloud.video.livestream.v1.InputAttachment.IAutomaticFailover} message AutomaticFailover message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticFailover.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomaticFailover message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover} AutomaticFailover + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticFailover.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputKeys && message.inputKeys.length)) + message.inputKeys = []; + message.inputKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomaticFailover message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover} AutomaticFailover + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticFailover.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomaticFailover message. + * @function verify + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomaticFailover.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputKeys != null && message.hasOwnProperty("inputKeys")) { + if (!Array.isArray(message.inputKeys)) + return "inputKeys: array expected"; + for (var i = 0; i < message.inputKeys.length; ++i) + if (!$util.isString(message.inputKeys[i])) + return "inputKeys: string[] expected"; + } + return null; + }; + + /** + * Creates an AutomaticFailover message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover} AutomaticFailover + */ + AutomaticFailover.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover) + return object; + var message = new $root.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover(); + if (object.inputKeys) { + if (!Array.isArray(object.inputKeys)) + throw TypeError(".google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover.inputKeys: array expected"); + message.inputKeys = []; + for (var i = 0; i < object.inputKeys.length; ++i) + message.inputKeys[i] = String(object.inputKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from an AutomaticFailover message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover} message AutomaticFailover + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomaticFailover.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputKeys = []; + if (message.inputKeys && message.inputKeys.length) { + object.inputKeys = []; + for (var j = 0; j < message.inputKeys.length; ++j) + object.inputKeys[j] = message.inputKeys[j]; + } + return object; + }; + + /** + * Converts this AutomaticFailover to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @instance + * @returns {Object.} JSON object + */ + AutomaticFailover.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomaticFailover + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomaticFailover.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover"; + }; + + return AutomaticFailover; + })(); + + return InputAttachment; + })(); + + v1.Event = (function() { + + /** + * Properties of an Event. + * @memberof google.cloud.video.livestream.v1 + * @interface IEvent + * @property {string|null} [name] Event name + * @property {google.protobuf.ITimestamp|null} [createTime] Event createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Event updateTime + * @property {Object.|null} [labels] Event labels + * @property {google.cloud.video.livestream.v1.Event.IAdBreakTask|null} [adBreak] Event adBreak + * @property {boolean|null} [executeNow] Event executeNow + * @property {google.protobuf.ITimestamp|null} [executionTime] Event executionTime + * @property {google.cloud.video.livestream.v1.Event.State|null} [state] Event state + * @property {google.rpc.IStatus|null} [error] Event error + */ + + /** + * Constructs a new Event. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {google.cloud.video.livestream.v1.IEvent=} [properties] Properties to set + */ + function Event(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]]; + } + + /** + * Event name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.name = ""; + + /** + * Event createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.createTime = null; + + /** + * Event updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.updateTime = null; + + /** + * Event labels. + * @member {Object.} labels + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.labels = $util.emptyObject; + + /** + * Event adBreak. + * @member {google.cloud.video.livestream.v1.Event.IAdBreakTask|null|undefined} adBreak + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.adBreak = null; + + /** + * Event executeNow. + * @member {boolean} executeNow + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.executeNow = false; + + /** + * Event executionTime. + * @member {google.protobuf.ITimestamp|null|undefined} executionTime + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.executionTime = null; + + /** + * Event state. + * @member {google.cloud.video.livestream.v1.Event.State} state + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.state = 0; + + /** + * Event error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Event.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Event task. + * @member {"adBreak"|undefined} task + * @memberof google.cloud.video.livestream.v1.Event + * @instance + */ + Object.defineProperty(Event.prototype, "task", { + get: $util.oneOfGetter($oneOfFields = ["adBreak"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {google.cloud.video.livestream.v1.IEvent=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + + /** + * Encodes the specified Event message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {google.cloud.video.livestream.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.adBreak != null && Object.hasOwnProperty.call(message, "adBreak")) + $root.google.cloud.video.livestream.v1.Event.AdBreakTask.encode(message.adBreak, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executeNow != null && Object.hasOwnProperty.call(message, "executeNow")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.executeNow); + if (message.executionTime != null && Object.hasOwnProperty.call(message, "executionTime")) + $root.google.protobuf.Timestamp.encode(message.executionTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.state); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {google.cloud.video.livestream.v1.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Event(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.adBreak = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.decode(reader, reader.uint32()); + break; + } + case 9: { + message.executeNow = reader.bool(); + break; + } + case 10: { + message.executionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.state = reader.int32(); + break; + } + case 12: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Event message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.adBreak != null && message.hasOwnProperty("adBreak")) { + properties.task = 1; + { + var error = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.verify(message.adBreak); + if (error) + return "adBreak." + error; + } + } + if (message.executeNow != null && message.hasOwnProperty("executeNow")) + if (typeof message.executeNow !== "boolean") + return "executeNow: boolean expected"; + if (message.executionTime != null && message.hasOwnProperty("executionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.executionTime); + if (error) + return "executionTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + return null; + }; + + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Event} Event + */ + Event.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Event) + return object; + var message = new $root.google.cloud.video.livestream.v1.Event(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.adBreak != null) { + if (typeof object.adBreak !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.adBreak: object expected"); + message.adBreak = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.fromObject(object.adBreak); + } + if (object.executeNow != null) + message.executeNow = Boolean(object.executeNow); + if (object.executionTime != null) { + if (typeof object.executionTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.executionTime: object expected"); + message.executionTime = $root.google.protobuf.Timestamp.fromObject(object.executionTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "SCHEDULED": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "PENDING": + case 5: + message.state = 5; + break; + case "STOPPED": + case 6: + message.state = 6; + break; + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {google.cloud.video.livestream.v1.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.executeNow = false; + object.executionTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.error = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.adBreak != null && message.hasOwnProperty("adBreak")) { + object.adBreak = $root.google.cloud.video.livestream.v1.Event.AdBreakTask.toObject(message.adBreak, options); + if (options.oneofs) + object.task = "adBreak"; + } + if (message.executeNow != null && message.hasOwnProperty("executeNow")) + object.executeNow = message.executeNow; + if (message.executionTime != null && message.hasOwnProperty("executionTime")) + object.executionTime = $root.google.protobuf.Timestamp.toObject(message.executionTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.video.livestream.v1.Event.State[message.state] === undefined ? message.state : $root.google.cloud.video.livestream.v1.Event.State[message.state] : message.state; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event"; + }; + + Event.AdBreakTask = (function() { + + /** + * Properties of an AdBreakTask. + * @memberof google.cloud.video.livestream.v1.Event + * @interface IAdBreakTask + * @property {google.protobuf.IDuration|null} [duration] AdBreakTask duration + */ + + /** + * Constructs a new AdBreakTask. + * @memberof google.cloud.video.livestream.v1.Event + * @classdesc Represents an AdBreakTask. + * @implements IAdBreakTask + * @constructor + * @param {google.cloud.video.livestream.v1.Event.IAdBreakTask=} [properties] Properties to set + */ + function AdBreakTask(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdBreakTask duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @instance + */ + AdBreakTask.prototype.duration = null; + + /** + * Creates a new AdBreakTask instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IAdBreakTask=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.Event.AdBreakTask} AdBreakTask instance + */ + AdBreakTask.create = function create(properties) { + return new AdBreakTask(properties); + }; + + /** + * Encodes the specified AdBreakTask message. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IAdBreakTask} message AdBreakTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdBreakTask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdBreakTask message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.Event.AdBreakTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {google.cloud.video.livestream.v1.Event.IAdBreakTask} message AdBreakTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdBreakTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdBreakTask message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.Event.AdBreakTask} AdBreakTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdBreakTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.Event.AdBreakTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdBreakTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.Event.AdBreakTask} AdBreakTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdBreakTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdBreakTask message. + * @function verify + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdBreakTask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates an AdBreakTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.Event.AdBreakTask} AdBreakTask + */ + AdBreakTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.Event.AdBreakTask) + return object; + var message = new $root.google.cloud.video.livestream.v1.Event.AdBreakTask(); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.video.livestream.v1.Event.AdBreakTask.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from an AdBreakTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {google.cloud.video.livestream.v1.Event.AdBreakTask} message AdBreakTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdBreakTask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.duration = null; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this AdBreakTask to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @instance + * @returns {Object.} JSON object + */ + AdBreakTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdBreakTask + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.Event.AdBreakTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdBreakTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.Event.AdBreakTask"; + }; + + return AdBreakTask; + })(); + + /** + * State enum. + * @name google.cloud.video.livestream.v1.Event.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} PENDING=5 PENDING value + * @property {number} STOPPED=6 STOPPED value + */ + Event.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "PENDING"] = 5; + values[valuesById[6] = "STOPPED"] = 6; + return values; + })(); + + return Event; + })(); + + v1.LivestreamService = (function() { + + /** + * Constructs a new LivestreamService service. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a LivestreamService + * @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 LivestreamService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LivestreamService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LivestreamService; + + /** + * Creates new LivestreamService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @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 {LivestreamService} RPC service. Useful where requests and/or responses are streamed. + */ + LivestreamService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef CreateChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateChannel. + * @function createChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} request CreateChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.CreateChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.createChannel = function createChannel(request, callback) { + return this.rpcCall(createChannel, $root.google.cloud.video.livestream.v1.CreateChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateChannel" }); + + /** + * Calls CreateChannel. + * @function createChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} request CreateChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listChannels}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef ListChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.ListChannelsResponse} [response] ListChannelsResponse + */ + + /** + * Calls ListChannels. + * @function listChannels + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} request ListChannelsRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.ListChannelsCallback} callback Node-style callback called with the error, if any, and ListChannelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.listChannels = function listChannels(request, callback) { + return this.rpcCall(listChannels, $root.google.cloud.video.livestream.v1.ListChannelsRequest, $root.google.cloud.video.livestream.v1.ListChannelsResponse, request, callback); + }, "name", { value: "ListChannels" }); + + /** + * Calls ListChannels. + * @function listChannels + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} request ListChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef GetChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Channel} [response] Channel + */ + + /** + * Calls GetChannel. + * @function getChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} request GetChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.GetChannelCallback} callback Node-style callback called with the error, if any, and Channel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.getChannel = function getChannel(request, callback) { + return this.rpcCall(getChannel, $root.google.cloud.video.livestream.v1.GetChannelRequest, $root.google.cloud.video.livestream.v1.Channel, request, callback); + }, "name", { value: "GetChannel" }); + + /** + * Calls GetChannel. + * @function getChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} request GetChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef DeleteChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteChannel. + * @function deleteChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} request DeleteChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.deleteChannel = function deleteChannel(request, callback) { + return this.rpcCall(deleteChannel, $root.google.cloud.video.livestream.v1.DeleteChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteChannel" }); + + /** + * Calls DeleteChannel. + * @function deleteChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} request DeleteChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef UpdateChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateChannel. + * @function updateChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} request UpdateChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.UpdateChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.updateChannel = function updateChannel(request, callback) { + return this.rpcCall(updateChannel, $root.google.cloud.video.livestream.v1.UpdateChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateChannel" }); + + /** + * Calls UpdateChannel. + * @function updateChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} request UpdateChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|startChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef StartChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartChannel. + * @function startChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} request StartChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.StartChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.startChannel = function startChannel(request, callback) { + return this.rpcCall(startChannel, $root.google.cloud.video.livestream.v1.StartChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartChannel" }); + + /** + * Calls StartChannel. + * @function startChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} request StartChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|stopChannel}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef StopChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopChannel. + * @function stopChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} request StopChannelRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.StopChannelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.stopChannel = function stopChannel(request, callback) { + return this.rpcCall(stopChannel, $root.google.cloud.video.livestream.v1.StopChannelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopChannel" }); + + /** + * Calls StopChannel. + * @function stopChannel + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} request StopChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef CreateInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInput. + * @function createInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} request CreateInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.CreateInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.createInput = function createInput(request, callback) { + return this.rpcCall(createInput, $root.google.cloud.video.livestream.v1.CreateInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInput" }); + + /** + * Calls CreateInput. + * @function createInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} request CreateInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listInputs}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef ListInputsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.ListInputsResponse} [response] ListInputsResponse + */ + + /** + * Calls ListInputs. + * @function listInputs + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListInputsRequest} request ListInputsRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.ListInputsCallback} callback Node-style callback called with the error, if any, and ListInputsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.listInputs = function listInputs(request, callback) { + return this.rpcCall(listInputs, $root.google.cloud.video.livestream.v1.ListInputsRequest, $root.google.cloud.video.livestream.v1.ListInputsResponse, request, callback); + }, "name", { value: "ListInputs" }); + + /** + * Calls ListInputs. + * @function listInputs + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListInputsRequest} request ListInputsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef GetInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Input} [response] Input + */ + + /** + * Calls GetInput. + * @function getInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetInputRequest} request GetInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.GetInputCallback} callback Node-style callback called with the error, if any, and Input + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.getInput = function getInput(request, callback) { + return this.rpcCall(getInput, $root.google.cloud.video.livestream.v1.GetInputRequest, $root.google.cloud.video.livestream.v1.Input, request, callback); + }, "name", { value: "GetInput" }); + + /** + * Calls GetInput. + * @function getInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetInputRequest} request GetInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef DeleteInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInput. + * @function deleteInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} request DeleteInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.deleteInput = function deleteInput(request, callback) { + return this.rpcCall(deleteInput, $root.google.cloud.video.livestream.v1.DeleteInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInput" }); + + /** + * Calls DeleteInput. + * @function deleteInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} request DeleteInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|updateInput}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef UpdateInputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInput. + * @function updateInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} request UpdateInputRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.UpdateInputCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.updateInput = function updateInput(request, callback) { + return this.rpcCall(updateInput, $root.google.cloud.video.livestream.v1.UpdateInputRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInput" }); + + /** + * Calls UpdateInput. + * @function updateInput + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} request UpdateInputRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|createEvent}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef CreateEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Event} [response] Event + */ + + /** + * Calls CreateEvent. + * @function createEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} request CreateEventRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.CreateEventCallback} callback Node-style callback called with the error, if any, and Event + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.createEvent = function createEvent(request, callback) { + return this.rpcCall(createEvent, $root.google.cloud.video.livestream.v1.CreateEventRequest, $root.google.cloud.video.livestream.v1.Event, request, callback); + }, "name", { value: "CreateEvent" }); + + /** + * Calls CreateEvent. + * @function createEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} request CreateEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|listEvents}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef ListEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.ListEventsResponse} [response] ListEventsResponse + */ + + /** + * Calls ListEvents. + * @function listEvents + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListEventsRequest} request ListEventsRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.ListEventsCallback} callback Node-style callback called with the error, if any, and ListEventsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.listEvents = function listEvents(request, callback) { + return this.rpcCall(listEvents, $root.google.cloud.video.livestream.v1.ListEventsRequest, $root.google.cloud.video.livestream.v1.ListEventsResponse, request, callback); + }, "name", { value: "ListEvents" }); + + /** + * Calls ListEvents. + * @function listEvents + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IListEventsRequest} request ListEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|getEvent}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef GetEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.livestream.v1.Event} [response] Event + */ + + /** + * Calls GetEvent. + * @function getEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetEventRequest} request GetEventRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.GetEventCallback} callback Node-style callback called with the error, if any, and Event + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.getEvent = function getEvent(request, callback) { + return this.rpcCall(getEvent, $root.google.cloud.video.livestream.v1.GetEventRequest, $root.google.cloud.video.livestream.v1.Event, request, callback); + }, "name", { value: "GetEvent" }); + + /** + * Calls GetEvent. + * @function getEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IGetEventRequest} request GetEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.livestream.v1.LivestreamService|deleteEvent}. + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @typedef DeleteEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteEvent. + * @function deleteEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} request DeleteEventRequest message or plain object + * @param {google.cloud.video.livestream.v1.LivestreamService.DeleteEventCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LivestreamService.prototype.deleteEvent = function deleteEvent(request, callback) { + return this.rpcCall(deleteEvent, $root.google.cloud.video.livestream.v1.DeleteEventRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEvent" }); + + /** + * Calls DeleteEvent. + * @function deleteEvent + * @memberof google.cloud.video.livestream.v1.LivestreamService + * @instance + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} request DeleteEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LivestreamService; + })(); + + v1.CreateChannelRequest = (function() { + + /** + * Properties of a CreateChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface ICreateChannelRequest + * @property {string|null} [parent] CreateChannelRequest parent + * @property {google.cloud.video.livestream.v1.IChannel|null} [channel] CreateChannelRequest channel + * @property {string|null} [channelId] CreateChannelRequest channelId + * @property {string|null} [requestId] CreateChannelRequest requestId + */ + + /** + * Constructs a new CreateChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a CreateChannelRequest. + * @implements ICreateChannelRequest + * @constructor + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest=} [properties] Properties to set + */ + function CreateChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateChannelRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance + */ + CreateChannelRequest.prototype.parent = ""; + + /** + * CreateChannelRequest channel. + * @member {google.cloud.video.livestream.v1.IChannel|null|undefined} channel + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance + */ + CreateChannelRequest.prototype.channel = null; + + /** + * CreateChannelRequest channelId. + * @member {string} channelId + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance + */ + CreateChannelRequest.prototype.channelId = ""; + + /** + * CreateChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance + */ + CreateChannelRequest.prototype.requestId = ""; + + /** + * Creates a new CreateChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest instance + */ + CreateChannelRequest.create = function create(properties) { + return new CreateChannelRequest(properties); + }; + + /** + * Encodes the specified CreateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} message CreateChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.google.cloud.video.livestream.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.channelId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateChannelRequest} message CreateChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.channel = $root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32()); + break; + } + case 3: { + message.channelId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateChannelRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.CreateChannelRequest} CreateChannelRequest + */ + CreateChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.CreateChannelRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.CreateChannelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".google.cloud.video.livestream.v1.CreateChannelRequest.channel: object expected"); + message.channel = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channel); + } + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.CreateChannelRequest} message CreateChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.channel = null; + object.channelId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channel, options); + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateChannelRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.CreateChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateChannelRequest"; + }; + + return CreateChannelRequest; + })(); + + v1.ListChannelsRequest = (function() { + + /** + * Properties of a ListChannelsRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IListChannelsRequest + * @property {string|null} [parent] ListChannelsRequest parent + * @property {number|null} [pageSize] ListChannelsRequest pageSize + * @property {string|null} [pageToken] ListChannelsRequest pageToken + * @property {string|null} [filter] ListChannelsRequest filter + * @property {string|null} [orderBy] ListChannelsRequest orderBy + */ + + /** + * Constructs a new ListChannelsRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListChannelsRequest. + * @implements IListChannelsRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IListChannelsRequest=} [properties] Properties to set + */ + function ListChannelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.parent = ""; + + /** + * ListChannelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.pageSize = 0; + + /** + * ListChannelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.pageToken = ""; + + /** + * ListChannelsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.filter = ""; + + /** + * ListChannelsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + */ + ListChannelsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListChannelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListChannelsRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest instance + */ + ListChannelsRequest.create = function create(properties) { + return new ListChannelsRequest(properties); + }; + + /** + * Encodes the specified ListChannelsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} message ListChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListChannelsRequest} message ListChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListChannelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelsRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListChannelsRequest} ListChannelsRequest + */ + ListChannelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListChannelsRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListChannelsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {google.cloud.video.livestream.v1.ListChannelsRequest} message ListChannelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListChannelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChannelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelsRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListChannelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListChannelsRequest"; + }; + + return ListChannelsRequest; + })(); + + v1.ListChannelsResponse = (function() { + + /** + * Properties of a ListChannelsResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IListChannelsResponse + * @property {Array.|null} [channels] ListChannelsResponse channels + * @property {string|null} [nextPageToken] ListChannelsResponse nextPageToken + * @property {Array.|null} [unreachable] ListChannelsResponse unreachable + */ + + /** + * Constructs a new ListChannelsResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListChannelsResponse. + * @implements IListChannelsResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IListChannelsResponse=} [properties] Properties to set + */ + function ListChannelsResponse(properties) { + this.channels = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelsResponse channels. + * @member {Array.} channels + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @instance + */ + ListChannelsResponse.prototype.channels = $util.emptyArray; + + /** + * ListChannelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @instance + */ + ListChannelsResponse.prototype.nextPageToken = ""; + + /** + * ListChannelsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @instance + */ + ListChannelsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListChannelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListChannelsResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse instance + */ + ListChannelsResponse.create = function create(properties) { + return new ListChannelsResponse(properties); + }; + + /** + * Encodes the specified ListChannelsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListChannelsResponse} message ListChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) + for (var i = 0; i < message.channels.length; ++i) + $root.google.cloud.video.livestream.v1.Channel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListChannelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListChannelsResponse} message ListChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListChannelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelsResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (var i = 0; i < message.channels.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channels[i]); + if (error) + return "channels." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListChannelsResponse} ListChannelsResponse + */ + ListChannelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListChannelsResponse) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListChannelsResponse(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.channels: array expected"); + message.channels = []; + for (var i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.channels: object expected"); + message.channels[i] = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channels[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.livestream.v1.ListChannelsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {google.cloud.video.livestream.v1.ListChannelsResponse} message ListChannelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.channels = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.channels && message.channels.length) { + object.channels = []; + for (var j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channels[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListChannelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChannelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelsResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListChannelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListChannelsResponse"; + }; + + return ListChannelsResponse; + })(); + + v1.GetChannelRequest = (function() { + + /** + * Properties of a GetChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IGetChannelRequest + * @property {string|null} [name] GetChannelRequest name + */ + + /** + * Constructs a new GetChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a GetChannelRequest. + * @implements IGetChannelRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IGetChannelRequest=} [properties] Properties to set + */ + function GetChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChannelRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @instance + */ + GetChannelRequest.prototype.name = ""; + + /** + * Creates a new GetChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest instance + */ + GetChannelRequest.create = function create(properties) { + return new GetChannelRequest(properties); + }; + + /** + * Encodes the specified GetChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} message GetChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChannelRequest.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 GetChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetChannelRequest} message GetChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetChannelRequest(); + 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 GetChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChannelRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChannelRequest.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 GetChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.GetChannelRequest} GetChannelRequest + */ + GetChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.GetChannelRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.GetChannelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.GetChannelRequest} message GetChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChannelRequest.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 GetChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @instance + * @returns {Object.} JSON object + */ + GetChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChannelRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.GetChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetChannelRequest"; + }; + + return GetChannelRequest; + })(); + + v1.DeleteChannelRequest = (function() { + + /** + * Properties of a DeleteChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IDeleteChannelRequest + * @property {string|null} [name] DeleteChannelRequest name + * @property {string|null} [requestId] DeleteChannelRequest requestId + * @property {boolean|null} [force] DeleteChannelRequest force + */ + + /** + * Constructs a new DeleteChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a DeleteChannelRequest. + * @implements IDeleteChannelRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest=} [properties] Properties to set + */ + function DeleteChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteChannelRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @instance + */ + DeleteChannelRequest.prototype.name = ""; + + /** + * DeleteChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @instance + */ + DeleteChannelRequest.prototype.requestId = ""; + + /** + * DeleteChannelRequest force. + * @member {boolean} force + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @instance + */ + DeleteChannelRequest.prototype.force = false; + + /** + * Creates a new DeleteChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest instance + */ + DeleteChannelRequest.create = function create(properties) { + return new DeleteChannelRequest(properties); + }; + + /** + * Encodes the specified DeleteChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} message DeleteChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteChannelRequest} message DeleteChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteChannelRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.DeleteChannelRequest} DeleteChannelRequest + */ + DeleteChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.DeleteChannelRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.DeleteChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.DeleteChannelRequest} message DeleteChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteChannelRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.DeleteChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteChannelRequest"; + }; + + return DeleteChannelRequest; + })(); + + v1.UpdateChannelRequest = (function() { + + /** + * Properties of an UpdateChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IUpdateChannelRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChannelRequest updateMask + * @property {google.cloud.video.livestream.v1.IChannel|null} [channel] UpdateChannelRequest channel + * @property {string|null} [requestId] UpdateChannelRequest requestId + */ + + /** + * Constructs a new UpdateChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an UpdateChannelRequest. + * @implements IUpdateChannelRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest=} [properties] Properties to set + */ + function UpdateChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateChannelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @instance + */ + UpdateChannelRequest.prototype.updateMask = null; + + /** + * UpdateChannelRequest channel. + * @member {google.cloud.video.livestream.v1.IChannel|null|undefined} channel + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @instance + */ + UpdateChannelRequest.prototype.channel = null; + + /** + * UpdateChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @instance + */ + UpdateChannelRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest instance + */ + UpdateChannelRequest.create = function create(properties) { + return new UpdateChannelRequest(properties); + }; + + /** + * Encodes the specified UpdateChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} message UpdateChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.google.cloud.video.livestream.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateChannelRequest} message UpdateChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.UpdateChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.channel = $root.google.cloud.video.livestream.v1.Channel.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateChannelRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.channel != null && message.hasOwnProperty("channel")) { + var error = $root.google.cloud.video.livestream.v1.Channel.verify(message.channel); + if (error) + return "channel." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.UpdateChannelRequest} UpdateChannelRequest + */ + UpdateChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.UpdateChannelRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.UpdateChannelRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateChannelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateChannelRequest.channel: object expected"); + message.channel = $root.google.cloud.video.livestream.v1.Channel.fromObject(object.channel); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.UpdateChannelRequest} message UpdateChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.channel = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.google.cloud.video.livestream.v1.Channel.toObject(message.channel, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateChannelRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.UpdateChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.UpdateChannelRequest"; + }; + + return UpdateChannelRequest; + })(); + + v1.StartChannelRequest = (function() { + + /** + * Properties of a StartChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IStartChannelRequest + * @property {string|null} [name] StartChannelRequest name + * @property {string|null} [requestId] StartChannelRequest requestId + */ + + /** + * Constructs a new StartChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a StartChannelRequest. + * @implements IStartChannelRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IStartChannelRequest=} [properties] Properties to set + */ + function StartChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartChannelRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @instance + */ + StartChannelRequest.prototype.name = ""; + + /** + * StartChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @instance + */ + StartChannelRequest.prototype.requestId = ""; + + /** + * Creates a new StartChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IStartChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest instance + */ + StartChannelRequest.create = function create(properties) { + return new StartChannelRequest(properties); + }; + + /** + * Encodes the specified StartChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} message StartChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified StartChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StartChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IStartChannelRequest} message StartChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.StartChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartChannelRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a StartChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.StartChannelRequest} StartChannelRequest + */ + StartChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.StartChannelRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.StartChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a StartChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.StartChannelRequest} message StartChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this StartChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @instance + * @returns {Object.} JSON object + */ + StartChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartChannelRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.StartChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.StartChannelRequest"; + }; + + return StartChannelRequest; + })(); + + v1.StopChannelRequest = (function() { + + /** + * Properties of a StopChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IStopChannelRequest + * @property {string|null} [name] StopChannelRequest name + * @property {string|null} [requestId] StopChannelRequest requestId + */ + + /** + * Constructs a new StopChannelRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a StopChannelRequest. + * @implements IStopChannelRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IStopChannelRequest=} [properties] Properties to set + */ + function StopChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopChannelRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @instance + */ + StopChannelRequest.prototype.name = ""; + + /** + * StopChannelRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @instance + */ + StopChannelRequest.prototype.requestId = ""; + + /** + * Creates a new StopChannelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IStopChannelRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest instance + */ + StopChannelRequest.create = function create(properties) { + return new StopChannelRequest(properties); + }; + + /** + * Encodes the specified StopChannelRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} message StopChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified StopChannelRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.StopChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.IStopChannelRequest} message StopChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.StopChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopChannelRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a StopChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.StopChannelRequest} StopChannelRequest + */ + StopChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.StopChannelRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.StopChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a StopChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {google.cloud.video.livestream.v1.StopChannelRequest} message StopChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this StopChannelRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @instance + * @returns {Object.} JSON object + */ + StopChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopChannelRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.StopChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.StopChannelRequest"; + }; + + return StopChannelRequest; + })(); + + v1.CreateInputRequest = (function() { + + /** + * Properties of a CreateInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface ICreateInputRequest + * @property {string|null} [parent] CreateInputRequest parent + * @property {google.cloud.video.livestream.v1.IInput|null} [input] CreateInputRequest input + * @property {string|null} [inputId] CreateInputRequest inputId + * @property {string|null} [requestId] CreateInputRequest requestId + */ + + /** + * Constructs a new CreateInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a CreateInputRequest. + * @implements ICreateInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.ICreateInputRequest=} [properties] Properties to set + */ + function CreateInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInputRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.parent = ""; + + /** + * CreateInputRequest input. + * @member {google.cloud.video.livestream.v1.IInput|null|undefined} input + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.input = null; + + /** + * CreateInputRequest inputId. + * @member {string} inputId + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.inputId = ""; + + /** + * CreateInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + */ + CreateInputRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest instance + */ + CreateInputRequest.create = function create(properties) { + return new CreateInputRequest(properties); + }; + + /** + * Encodes the specified CreateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} message CreateInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.cloud.video.livestream.v1.Input.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputId != null && Object.hasOwnProperty.call(message, "inputId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateInputRequest} message CreateInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.input = $root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inputId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInputRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.cloud.video.livestream.v1.Input.verify(message.input); + if (error) + return "input." + error; + } + if (message.inputId != null && message.hasOwnProperty("inputId")) + if (!$util.isString(message.inputId)) + return "inputId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.CreateInputRequest} CreateInputRequest + */ + CreateInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.CreateInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.CreateInputRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.video.livestream.v1.CreateInputRequest.input: object expected"); + message.input = $root.google.cloud.video.livestream.v1.Input.fromObject(object.input); + } + if (object.inputId != null) + message.inputId = String(object.inputId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.CreateInputRequest} message CreateInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.input = null; + object.inputId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.cloud.video.livestream.v1.Input.toObject(message.input, options); + if (message.inputId != null && message.hasOwnProperty("inputId")) + object.inputId = message.inputId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.CreateInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateInputRequest"; + }; + + return CreateInputRequest; + })(); + + v1.ListInputsRequest = (function() { + + /** + * Properties of a ListInputsRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IListInputsRequest + * @property {string|null} [parent] ListInputsRequest parent + * @property {number|null} [pageSize] ListInputsRequest pageSize + * @property {string|null} [pageToken] ListInputsRequest pageToken + * @property {string|null} [filter] ListInputsRequest filter + * @property {string|null} [orderBy] ListInputsRequest orderBy + */ + + /** + * Constructs a new ListInputsRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListInputsRequest. + * @implements IListInputsRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IListInputsRequest=} [properties] Properties to set + */ + function ListInputsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInputsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @instance + */ + ListInputsRequest.prototype.parent = ""; + + /** + * ListInputsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @instance + */ + ListInputsRequest.prototype.pageSize = 0; + + /** + * ListInputsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @instance + */ + ListInputsRequest.prototype.pageToken = ""; + + /** + * ListInputsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @instance + */ + ListInputsRequest.prototype.filter = ""; + + /** + * ListInputsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @instance + */ + ListInputsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInputsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListInputsRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest instance + */ + ListInputsRequest.create = function create(properties) { + return new ListInputsRequest(properties); + }; + + /** + * Encodes the specified ListInputsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListInputsRequest} message ListInputsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInputsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInputsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListInputsRequest} message ListInputsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInputsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInputsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInputsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListInputsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInputsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInputsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInputsRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInputsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInputsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListInputsRequest} ListInputsRequest + */ + ListInputsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListInputsRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListInputsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInputsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {google.cloud.video.livestream.v1.ListInputsRequest} message ListInputsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInputsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInputsRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInputsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInputsRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListInputsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInputsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListInputsRequest"; + }; + + return ListInputsRequest; + })(); + + v1.ListInputsResponse = (function() { + + /** + * Properties of a ListInputsResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IListInputsResponse + * @property {Array.|null} [inputs] ListInputsResponse inputs + * @property {string|null} [nextPageToken] ListInputsResponse nextPageToken + * @property {Array.|null} [unreachable] ListInputsResponse unreachable + */ + + /** + * Constructs a new ListInputsResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListInputsResponse. + * @implements IListInputsResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IListInputsResponse=} [properties] Properties to set + */ + function ListInputsResponse(properties) { + this.inputs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInputsResponse inputs. + * @member {Array.} inputs + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + */ + ListInputsResponse.prototype.inputs = $util.emptyArray; + + /** + * ListInputsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + */ + ListInputsResponse.prototype.nextPageToken = ""; + + /** + * ListInputsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + */ + ListInputsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInputsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListInputsResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse instance + */ + ListInputsResponse.create = function create(properties) { + return new ListInputsResponse(properties); + }; + + /** + * Encodes the specified ListInputsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListInputsResponse} message ListInputsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInputsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.cloud.video.livestream.v1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInputsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListInputsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListInputsResponse} message ListInputsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInputsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInputsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInputsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListInputsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInputsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInputsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInputsResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInputsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Input.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInputsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListInputsResponse} ListInputsResponse + */ + ListInputsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListInputsResponse) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListInputsResponse(); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.inputs: object expected"); + message.inputs[i] = $root.google.cloud.video.livestream.v1.Input.fromObject(object.inputs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.livestream.v1.ListInputsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInputsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {google.cloud.video.livestream.v1.ListInputsResponse} message ListInputsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInputsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.video.livestream.v1.Input.toObject(message.inputs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInputsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInputsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInputsResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListInputsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInputsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListInputsResponse"; + }; + + return ListInputsResponse; + })(); + + v1.GetInputRequest = (function() { + + /** + * Properties of a GetInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IGetInputRequest + * @property {string|null} [name] GetInputRequest name + */ + + /** + * Constructs a new GetInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a GetInputRequest. + * @implements IGetInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IGetInputRequest=} [properties] Properties to set + */ + function GetInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInputRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @instance + */ + GetInputRequest.prototype.name = ""; + + /** + * Creates a new GetInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest instance + */ + GetInputRequest.create = function create(properties) { + return new GetInputRequest(properties); + }; + + /** + * Encodes the specified GetInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetInputRequest} message GetInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInputRequest.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 GetInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetInputRequest} message GetInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetInputRequest(); + 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 GetInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInputRequest.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 GetInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.GetInputRequest} GetInputRequest + */ + GetInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.GetInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.GetInputRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {google.cloud.video.livestream.v1.GetInputRequest} message GetInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInputRequest.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 GetInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @instance + * @returns {Object.} JSON object + */ + GetInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.GetInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetInputRequest"; + }; + + return GetInputRequest; + })(); + + v1.DeleteInputRequest = (function() { + + /** + * Properties of a DeleteInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IDeleteInputRequest + * @property {string|null} [name] DeleteInputRequest name + * @property {string|null} [requestId] DeleteInputRequest requestId + */ + + /** + * Constructs a new DeleteInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a DeleteInputRequest. + * @implements IDeleteInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest=} [properties] Properties to set + */ + function DeleteInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInputRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @instance + */ + DeleteInputRequest.prototype.name = ""; + + /** + * DeleteInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @instance + */ + DeleteInputRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest instance + */ + DeleteInputRequest.create = function create(properties) { + return new DeleteInputRequest(properties); + }; + + /** + * Encodes the specified DeleteInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} message DeleteInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteInputRequest} message DeleteInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInputRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.DeleteInputRequest} DeleteInputRequest + */ + DeleteInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.DeleteInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.DeleteInputRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {google.cloud.video.livestream.v1.DeleteInputRequest} message DeleteInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.DeleteInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteInputRequest"; + }; + + return DeleteInputRequest; + })(); + + v1.UpdateInputRequest = (function() { + + /** + * Properties of an UpdateInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IUpdateInputRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInputRequest updateMask + * @property {google.cloud.video.livestream.v1.IInput|null} [input] UpdateInputRequest input + * @property {string|null} [requestId] UpdateInputRequest requestId + */ + + /** + * Constructs a new UpdateInputRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an UpdateInputRequest. + * @implements IUpdateInputRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest=} [properties] Properties to set + */ + function UpdateInputRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInputRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + */ + UpdateInputRequest.prototype.updateMask = null; + + /** + * UpdateInputRequest input. + * @member {google.cloud.video.livestream.v1.IInput|null|undefined} input + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + */ + UpdateInputRequest.prototype.input = null; + + /** + * UpdateInputRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + */ + UpdateInputRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInputRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest instance + */ + UpdateInputRequest.create = function create(properties) { + return new UpdateInputRequest(properties); + }; + + /** + * Encodes the specified UpdateInputRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} message UpdateInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInputRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.cloud.video.livestream.v1.Input.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInputRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.UpdateInputRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.IUpdateInputRequest} message UpdateInputRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInputRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInputRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInputRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.UpdateInputRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.input = $root.google.cloud.video.livestream.v1.Input.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInputRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInputRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInputRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInputRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.cloud.video.livestream.v1.Input.verify(message.input); + if (error) + return "input." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInputRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.UpdateInputRequest} UpdateInputRequest + */ + UpdateInputRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.UpdateInputRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.UpdateInputRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateInputRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.video.livestream.v1.UpdateInputRequest.input: object expected"); + message.input = $root.google.cloud.video.livestream.v1.Input.fromObject(object.input); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInputRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {google.cloud.video.livestream.v1.UpdateInputRequest} message UpdateInputRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInputRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.input = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.cloud.video.livestream.v1.Input.toObject(message.input, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInputRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInputRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInputRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.UpdateInputRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.UpdateInputRequest"; + }; + + return UpdateInputRequest; + })(); + + v1.CreateEventRequest = (function() { + + /** + * Properties of a CreateEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface ICreateEventRequest + * @property {string|null} [parent] CreateEventRequest parent + * @property {google.cloud.video.livestream.v1.IEvent|null} [event] CreateEventRequest event + * @property {string|null} [eventId] CreateEventRequest eventId + * @property {string|null} [requestId] CreateEventRequest requestId + */ + + /** + * Constructs a new CreateEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a CreateEventRequest. + * @implements ICreateEventRequest + * @constructor + * @param {google.cloud.video.livestream.v1.ICreateEventRequest=} [properties] Properties to set + */ + function CreateEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEventRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.parent = ""; + + /** + * CreateEventRequest event. + * @member {google.cloud.video.livestream.v1.IEvent|null|undefined} event + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.event = null; + + /** + * CreateEventRequest eventId. + * @member {string} eventId + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.eventId = ""; + + /** + * CreateEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + */ + CreateEventRequest.prototype.requestId = ""; + + /** + * Creates a new CreateEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateEventRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest instance + */ + CreateEventRequest.create = function create(properties) { + return new CreateEventRequest(properties); + }; + + /** + * Encodes the specified CreateEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.video.livestream.v1.Event.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.eventId != null && Object.hasOwnProperty.call(message, "eventId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.eventId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.CreateEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.ICreateEventRequest} message CreateEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.CreateEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.event = $root.google.cloud.video.livestream.v1.Event.decode(reader, reader.uint32()); + break; + } + case 3: { + message.eventId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEventRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.event != null && message.hasOwnProperty("event")) { + var error = $root.google.cloud.video.livestream.v1.Event.verify(message.event); + if (error) + return "event." + error; + } + if (message.eventId != null && message.hasOwnProperty("eventId")) + if (!$util.isString(message.eventId)) + return "eventId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.CreateEventRequest} CreateEventRequest + */ + CreateEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.CreateEventRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.CreateEventRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.video.livestream.v1.CreateEventRequest.event: object expected"); + message.event = $root.google.cloud.video.livestream.v1.Event.fromObject(object.event); + } + if (object.eventId != null) + message.eventId = String(object.eventId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {google.cloud.video.livestream.v1.CreateEventRequest} message CreateEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.event = null; + object.eventId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.event != null && message.hasOwnProperty("event")) + object.event = $root.google.cloud.video.livestream.v1.Event.toObject(message.event, options); + if (message.eventId != null && message.hasOwnProperty("eventId")) + object.eventId = message.eventId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEventRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.CreateEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.CreateEventRequest"; + }; + + return CreateEventRequest; + })(); + + v1.ListEventsRequest = (function() { + + /** + * Properties of a ListEventsRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IListEventsRequest + * @property {string|null} [parent] ListEventsRequest parent + * @property {number|null} [pageSize] ListEventsRequest pageSize + * @property {string|null} [pageToken] ListEventsRequest pageToken + * @property {string|null} [filter] ListEventsRequest filter + * @property {string|null} [orderBy] ListEventsRequest orderBy + */ + + /** + * Constructs a new ListEventsRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListEventsRequest. + * @implements IListEventsRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IListEventsRequest=} [properties] Properties to set + */ + function ListEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.parent = ""; + + /** + * ListEventsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.pageSize = 0; + + /** + * ListEventsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.pageToken = ""; + + /** + * ListEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.filter = ""; + + /** + * ListEventsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + */ + ListEventsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListEventsRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest instance + */ + ListEventsRequest.create = function create(properties) { + return new ListEventsRequest(properties); + }; + + /** + * Encodes the specified ListEventsRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListEventsRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.IListEventsRequest} message ListEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventsRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListEventsRequest} ListEventsRequest + */ + ListEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListEventsRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {google.cloud.video.livestream.v1.ListEventsRequest} message ListEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListEventsRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventsRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListEventsRequest"; + }; + + return ListEventsRequest; + })(); + + v1.ListEventsResponse = (function() { + + /** + * Properties of a ListEventsResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IListEventsResponse + * @property {Array.|null} [events] ListEventsResponse events + * @property {string|null} [nextPageToken] ListEventsResponse nextPageToken + * @property {Array.|null} [unreachable] ListEventsResponse unreachable + */ + + /** + * Constructs a new ListEventsResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ListEventsResponse. + * @implements IListEventsResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IListEventsResponse=} [properties] Properties to set + */ + function ListEventsResponse(properties) { + this.events = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEventsResponse events. + * @member {Array.} events + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.events = $util.emptyArray; + + /** + * ListEventsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.nextPageToken = ""; + + /** + * ListEventsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + */ + ListEventsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListEventsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListEventsResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse instance + */ + ListEventsResponse.create = function create(properties) { + return new ListEventsResponse(properties); + }; + + /** + * Encodes the specified ListEventsResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + $root.google.cloud.video.livestream.v1.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListEventsResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ListEventsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.IListEventsResponse} message ListEventsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ListEventsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.google.cloud.video.livestream.v1.Event.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEventsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEventsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEventsResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEventsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.google.cloud.video.livestream.v1.Event.verify(message.events[i]); + if (error) + return "events." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListEventsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ListEventsResponse} ListEventsResponse + */ + ListEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ListEventsResponse) + return object; + var message = new $root.google.cloud.video.livestream.v1.ListEventsResponse(); + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.events[i] !== "object") + throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.events: object expected"); + message.events[i] = $root.google.cloud.video.livestream.v1.Event.fromObject(object.events[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.livestream.v1.ListEventsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListEventsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {google.cloud.video.livestream.v1.ListEventsResponse} message ListEventsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEventsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.events = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = $root.google.cloud.video.livestream.v1.Event.toObject(message.events[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListEventsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEventsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEventsResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ListEventsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ListEventsResponse"; + }; + + return ListEventsResponse; + })(); + + v1.GetEventRequest = (function() { + + /** + * Properties of a GetEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IGetEventRequest + * @property {string|null} [name] GetEventRequest name + */ + + /** + * Constructs a new GetEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a GetEventRequest. + * @implements IGetEventRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IGetEventRequest=} [properties] Properties to set + */ + function GetEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEventRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @instance + */ + GetEventRequest.prototype.name = ""; + + /** + * Creates a new GetEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetEventRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest instance + */ + GetEventRequest.create = function create(properties) { + return new GetEventRequest(properties); + }; + + /** + * Encodes the specified GetEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventRequest.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 GetEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.GetEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IGetEventRequest} message GetEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.GetEventRequest(); + 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 GetEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEventRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEventRequest.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 GetEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.GetEventRequest} GetEventRequest + */ + GetEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.GetEventRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.GetEventRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {google.cloud.video.livestream.v1.GetEventRequest} message GetEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEventRequest.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 GetEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @instance + * @returns {Object.} JSON object + */ + GetEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEventRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.GetEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.GetEventRequest"; + }; + + return GetEventRequest; + })(); + + v1.DeleteEventRequest = (function() { + + /** + * Properties of a DeleteEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @interface IDeleteEventRequest + * @property {string|null} [name] DeleteEventRequest name + * @property {string|null} [requestId] DeleteEventRequest requestId + */ + + /** + * Constructs a new DeleteEventRequest. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a DeleteEventRequest. + * @implements IDeleteEventRequest + * @constructor + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest=} [properties] Properties to set + */ + function DeleteEventRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEventRequest name. + * @member {string} name + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @instance + */ + DeleteEventRequest.prototype.name = ""; + + /** + * DeleteEventRequest requestId. + * @member {string} requestId + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @instance + */ + DeleteEventRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteEventRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest instance + */ + DeleteEventRequest.create = function create(properties) { + return new DeleteEventRequest(properties); + }; + + /** + * Encodes the specified DeleteEventRequest message. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteEventRequest message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.DeleteEventRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.IDeleteEventRequest} message DeleteEventRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.DeleteEventRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEventRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEventRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEventRequest message. + * @function verify + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEventRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteEventRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.DeleteEventRequest} DeleteEventRequest + */ + DeleteEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.DeleteEventRequest) + return object; + var message = new $root.google.cloud.video.livestream.v1.DeleteEventRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteEventRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {google.cloud.video.livestream.v1.DeleteEventRequest} message DeleteEventRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEventRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteEventRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEventRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEventRequest + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.DeleteEventRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.DeleteEventRequest"; + }; + + return DeleteEventRequest; + })(); + + v1.ChannelOperationResponse = (function() { + + /** + * Properties of a ChannelOperationResponse. + * @memberof google.cloud.video.livestream.v1 + * @interface IChannelOperationResponse + */ + + /** + * Constructs a new ChannelOperationResponse. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents a ChannelOperationResponse. + * @implements IChannelOperationResponse + * @constructor + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse=} [properties] Properties to set + */ + function ChannelOperationResponse(properties) { + if (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 ChannelOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse instance + */ + ChannelOperationResponse.create = function create(properties) { + return new ChannelOperationResponse(properties); + }; + + /** + * Encodes the specified ChannelOperationResponse message. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse} message ChannelOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ChannelOperationResponse message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.ChannelOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.IChannelOperationResponse} message ChannelOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.ChannelOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelOperationResponse message. + * @function verify + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ChannelOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.ChannelOperationResponse} ChannelOperationResponse + */ + ChannelOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.ChannelOperationResponse) + return object; + return new $root.google.cloud.video.livestream.v1.ChannelOperationResponse(); + }; + + /** + * Creates a plain object from a ChannelOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {google.cloud.video.livestream.v1.ChannelOperationResponse} message ChannelOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ChannelOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @instance + * @returns {Object.} JSON object + */ + ChannelOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelOperationResponse + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.ChannelOperationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelOperationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.ChannelOperationResponse"; + }; + + return ChannelOperationResponse; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.video.livestream.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.video.livestream.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.video.livestream.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.video.livestream.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.livestream.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.requestedCancellation = reader.bool(); + break; + } + case 6: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.livestream.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.livestream.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.video.livestream.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.video.livestream.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {google.cloud.video.livestream.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.video.livestream.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.livestream.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1; + })(); + + return livestream; + })(); + + return video; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.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.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-video-livestream/protos/protos.json b/packages/google-cloud-video-livestream/protos/protos.json new file mode 100644 index 00000000000..70363b6c26e --- /dev/null +++ b/packages/google-cloud-video-livestream/protos/protos.json @@ -0,0 +1,3066 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "video": { + "nested": { + "livestream": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Video.LiveStream.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/video/livestream/v1;livestream", + "java_multiple_files": true, + "java_outer_classname": "ServiceProto", + "java_package": "com.google.cloud.video.livestream.v1", + "php_namespace": "Google\\Cloud\\Video\\LiveStream\\V1", + "ruby_package": "Google::Cloud::Video::LiveStream::V1" + }, + "nested": { + "ElementaryStream": { + "oneofs": { + "elementaryStream": { + "oneof": [ + "videoStream", + "audioStream", + "textStream" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 4 + }, + "videoStream": { + "type": "VideoStream", + "id": 1 + }, + "audioStream": { + "type": "AudioStream", + "id": 2 + }, + "textStream": { + "type": "TextStream", + "id": 3 + } + } + }, + "MuxStream": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "container": { + "type": "string", + "id": 3 + }, + "elementaryStreams": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "segmentSettings": { + "type": "SegmentSettings", + "id": 5 + } + } + }, + "Manifest": { + "fields": { + "fileName": { + "type": "string", + "id": 1 + }, + "type": { + "type": "ManifestType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "muxStreams": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxSegmentCount": { + "type": "int32", + "id": 4 + }, + "segmentKeepDuration": { + "type": "google.protobuf.Duration", + "id": 5 + } + }, + "nested": { + "ManifestType": { + "values": { + "MANIFEST_TYPE_UNSPECIFIED": 0, + "HLS": 1, + "DASH": 2 + } + } + } + }, + "SpriteSheet": { + "fields": { + "format": { + "type": "string", + "id": 1 + }, + "filePrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "spriteWidthPixels": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "spriteHeightPixels": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columnCount": { + "type": "int32", + "id": 5 + }, + "rowCount": { + "type": "int32", + "id": 6 + }, + "interval": { + "type": "google.protobuf.Duration", + "id": 7 + }, + "quality": { + "type": "int32", + "id": 8 + } + } + }, + "PreprocessingConfig": { + "fields": { + "crop": { + "type": "Crop", + "id": 2 + }, + "pad": { + "type": "Pad", + "id": 3 + } + }, + "nested": { + "Crop": { + "fields": { + "topPixels": { + "type": "int32", + "id": 1 + }, + "bottomPixels": { + "type": "int32", + "id": 2 + }, + "leftPixels": { + "type": "int32", + "id": 3 + }, + "rightPixels": { + "type": "int32", + "id": 4 + } + } + }, + "Pad": { + "fields": { + "topPixels": { + "type": "int32", + "id": 1 + }, + "bottomPixels": { + "type": "int32", + "id": 2 + }, + "leftPixels": { + "type": "int32", + "id": 3 + }, + "rightPixels": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "VideoStream": { + "oneofs": { + "codecSettings": { + "oneof": [ + "h264" + ] + } + }, + "fields": { + "h264": { + "type": "H264CodecSettings", + "id": 20 + } + }, + "nested": { + "H264CodecSettings": { + "oneofs": { + "gopMode": { + "oneof": [ + "gopFrameCount", + "gopDuration" + ] + } + }, + "fields": { + "widthPixels": { + "type": "int32", + "id": 1 + }, + "heightPixels": { + "type": "int32", + "id": 2 + }, + "frameRate": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bitrateBps": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowOpenGop": { + "type": "bool", + "id": 6 + }, + "gopFrameCount": { + "type": "int32", + "id": 7 + }, + "gopDuration": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "vbvSizeBits": { + "type": "int32", + "id": 9 + }, + "vbvFullnessBits": { + "type": "int32", + "id": 10 + }, + "entropyCoder": { + "type": "string", + "id": 11 + }, + "bPyramid": { + "type": "bool", + "id": 12 + }, + "bFrameCount": { + "type": "int32", + "id": 13 + }, + "aqStrength": { + "type": "double", + "id": 14 + }, + "profile": { + "type": "string", + "id": 15 + }, + "tune": { + "type": "string", + "id": 16 + } + } + } + } + }, + "AudioStream": { + "fields": { + "transmux": { + "type": "bool", + "id": 8 + }, + "codec": { + "type": "string", + "id": 1 + }, + "bitrateBps": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "channelCount": { + "type": "int32", + "id": 3 + }, + "channelLayout": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "mapping": { + "rule": "repeated", + "type": "AudioMapping", + "id": 5 + }, + "sampleRateHertz": { + "type": "int32", + "id": 6 + } + }, + "nested": { + "AudioMapping": { + "fields": { + "inputKey": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputTrack": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputChannel": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputChannel": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "TextStream": { + "fields": { + "codec": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SegmentSettings": { + "fields": { + "segmentDuration": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "Input": { + "options": { + "(google.api.resource).type": "livestream.googleapis.com/Input", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/inputs/{input}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "tier": { + "type": "Tier", + "id": 14 + }, + "uri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "preprocessingConfig": { + "type": "PreprocessingConfig", + "id": 9 + }, + "securityRules": { + "type": "SecurityRule", + "id": 12 + }, + "inputStreamProperty": { + "type": "InputStreamProperty", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "RTMP_PUSH": 1, + "SRT_PUSH": 2 + } + }, + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "SD": 1, + "HD": 2, + "UHD": 3 + } + }, + "SecurityRule": { + "fields": { + "ipRanges": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "Channel": { + "options": { + "(google.api.resource).type": "livestream.googleapis.com/Channel", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/channels/{channel}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "inputAttachments": { + "rule": "repeated", + "type": "InputAttachment", + "id": 16 + }, + "activeInput": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "output": { + "type": "Output", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "elementaryStreams": { + "rule": "repeated", + "type": "ElementaryStream", + "id": 10 + }, + "muxStreams": { + "rule": "repeated", + "type": "MuxStream", + "id": 11 + }, + "manifests": { + "rule": "repeated", + "type": "Manifest", + "id": 12 + }, + "spriteSheets": { + "rule": "repeated", + "type": "SpriteSheet", + "id": 13 + }, + "streamingState": { + "type": "StreamingState", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamingError": { + "type": "google.rpc.Status", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logConfig": { + "type": "LogConfig", + "id": 19 + } + }, + "nested": { + "Output": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "StreamingState": { + "values": { + "STREAMING_STATE_UNSPECIFIED": 0, + "STREAMING": 1, + "AWAITING_INPUT": 2, + "STREAMING_ERROR": 4, + "STREAMING_NO_INPUT": 5, + "STOPPED": 6, + "STARTING": 7, + "STOPPING": 8 + } + } + } + }, + "LogConfig": { + "fields": { + "logSeverity": { + "type": "LogSeverity", + "id": 1 + } + }, + "nested": { + "LogSeverity": { + "values": { + "LOG_SEVERITY_UNSPECIFIED": 0, + "OFF": 1, + "DEBUG": 100, + "INFO": 200, + "WARNING": 400, + "ERROR": 500 + } + } + } + }, + "InputStreamProperty": { + "fields": { + "lastEstablishTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "videoStreams": { + "rule": "repeated", + "type": "VideoStreamProperty", + "id": 2 + }, + "audioStreams": { + "rule": "repeated", + "type": "AudioStreamProperty", + "id": 3 + } + } + }, + "VideoStreamProperty": { + "fields": { + "index": { + "type": "int32", + "id": 1 + }, + "videoFormat": { + "type": "VideoFormat", + "id": 2 + } + } + }, + "VideoFormat": { + "fields": { + "codec": { + "type": "string", + "id": 1 + }, + "widthPixels": { + "type": "int32", + "id": 2 + }, + "heightPixels": { + "type": "int32", + "id": 3 + }, + "frameRate": { + "type": "double", + "id": 4 + } + } + }, + "AudioStreamProperty": { + "fields": { + "index": { + "type": "int32", + "id": 1 + }, + "audioFormat": { + "type": "AudioFormat", + "id": 2 + } + } + }, + "AudioFormat": { + "fields": { + "codec": { + "type": "string", + "id": 1 + }, + "channelCount": { + "type": "int32", + "id": 2 + }, + "channelLayout": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "InputAttachment": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "input": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "livestream.googleapis.com/Input" + } + }, + "automaticFailover": { + "type": "AutomaticFailover", + "id": 3 + } + }, + "nested": { + "AutomaticFailover": { + "fields": { + "inputKeys": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "Event": { + "options": { + "(google.api.resource).type": "livestream.googleapis.com/Event", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/channels/{channel}/events/{event}" + }, + "oneofs": { + "task": { + "oneof": [ + "adBreak" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "adBreak": { + "type": "AdBreakTask", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "executeNow": { + "type": "bool", + "id": 9 + }, + "executionTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "state": { + "type": "State", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "AdBreakTask": { + "fields": { + "duration": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SCHEDULED": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "PENDING": 5, + "STOPPED": 6 + } + } + } + }, + "LivestreamService": { + "options": { + "(google.api.default_host)": "livestream.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateChannel": { + "requestType": "CreateChannelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/channels", + "(google.api.http).body": "channel", + "(google.api.method_signature)": "parent,channel,channel_id", + "(google.longrunning.operation_info).response_type": "Channel", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/channels", + "body": "channel" + } + }, + { + "(google.api.method_signature)": "parent,channel,channel_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Channel", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListChannels": { + "requestType": "ListChannelsRequest", + "responseType": "ListChannelsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/channels", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/channels" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetChannel": { + "requestType": "GetChannelRequest", + "responseType": "Channel", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/channels/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/channels/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteChannel": { + "requestType": "DeleteChannelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/channels/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/channels/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateChannel": { + "requestType": "UpdateChannelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{channel.name=projects/*/locations/*/channels/*}", + "(google.api.http).body": "channel", + "(google.api.method_signature)": "channel,update_mask", + "(google.longrunning.operation_info).response_type": "Channel", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{channel.name=projects/*/locations/*/channels/*}", + "body": "channel" + } + }, + { + "(google.api.method_signature)": "channel,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Channel", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StartChannel": { + "requestType": "StartChannelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/channels/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ChannelOperationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/channels/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ChannelOperationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StopChannel": { + "requestType": "StopChannelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/channels/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ChannelOperationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/channels/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ChannelOperationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateInput": { + "requestType": "CreateInputRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/inputs", + "(google.api.http).body": "input", + "(google.api.method_signature)": "parent,input,input_id", + "(google.longrunning.operation_info).response_type": "Input", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/inputs", + "body": "input" + } + }, + { + "(google.api.method_signature)": "parent,input,input_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Input", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListInputs": { + "requestType": "ListInputsRequest", + "responseType": "ListInputsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/inputs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/inputs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInput": { + "requestType": "GetInputRequest", + "responseType": "Input", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/inputs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/inputs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteInput": { + "requestType": "DeleteInputRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/inputs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/inputs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInput": { + "requestType": "UpdateInputRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{input.name=projects/*/locations/*/inputs/*}", + "(google.api.http).body": "input", + "(google.api.method_signature)": "input,update_mask", + "(google.longrunning.operation_info).response_type": "Input", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{input.name=projects/*/locations/*/inputs/*}", + "body": "input" + } + }, + { + "(google.api.method_signature)": "input,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Input", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateEvent": { + "requestType": "CreateEventRequest", + "responseType": "Event", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/channels/*}/events", + "(google.api.http).body": "event", + "(google.api.method_signature)": "parent,event,event_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/channels/*}/events", + "body": "event" + } + }, + { + "(google.api.method_signature)": "parent,event,event_id" + } + ] + }, + "ListEvents": { + "requestType": "ListEventsRequest", + "responseType": "ListEventsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/channels/*}/events", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/channels/*}/events" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEvent": { + "requestType": "GetEventRequest", + "responseType": "Event", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/channels/*/events/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/channels/*/events/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteEvent": { + "requestType": "DeleteEventRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/channels/*/events/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/channels/*/events/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateChannelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "livestream.googleapis.com/Channel" + } + }, + "channel": { + "type": "Channel", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "channelId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "ListChannelsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "livestream.googleapis.com/Channel" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListChannelsResponse": { + "fields": { + "channels": { + "rule": "repeated", + "type": "Channel", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetChannelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Channel" + } + } + } + }, + "DeleteChannelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Channel" + } + }, + "requestId": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "UpdateChannelRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "channel": { + "type": "Channel", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "StartChannelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Channel" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "StopChannelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Channel" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "CreateInputRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "livestream.googleapis.com/Input" + } + }, + "input": { + "type": "Input", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "ListInputsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "livestream.googleapis.com/Input" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInputsResponse": { + "fields": { + "inputs": { + "rule": "repeated", + "type": "Input", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInputRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Input" + } + } + } + }, + "DeleteInputRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Input" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "UpdateInputRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "input": { + "type": "Input", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "CreateEventRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "livestream.googleapis.com/Event" + } + }, + "event": { + "type": "Event", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "eventId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "ListEventsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "livestream.googleapis.com/Event" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListEventsResponse": { + "fields": { + "events": { + "rule": "repeated", + "type": "Event", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetEventRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Event" + } + } + } + }, + "DeleteEventRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "livestream.googleapis.com/Event" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "ChannelOperationResponse": { + "fields": {} + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "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 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-video-livestream/samples/README.md b/packages/google-cloud-video-livestream/samples/README.md new file mode 100644 index 00000000000..d0b8e9e381c --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/README.md @@ -0,0 +1,356 @@ +[//]: # "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 + +# [Live Stream API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Livestream_service.create_channel](#livestream_service.create_channel) + * [Livestream_service.create_event](#livestream_service.create_event) + * [Livestream_service.create_input](#livestream_service.create_input) + * [Livestream_service.delete_channel](#livestream_service.delete_channel) + * [Livestream_service.delete_event](#livestream_service.delete_event) + * [Livestream_service.delete_input](#livestream_service.delete_input) + * [Livestream_service.get_channel](#livestream_service.get_channel) + * [Livestream_service.get_event](#livestream_service.get_event) + * [Livestream_service.get_input](#livestream_service.get_input) + * [Livestream_service.list_channels](#livestream_service.list_channels) + * [Livestream_service.list_events](#livestream_service.list_events) + * [Livestream_service.list_inputs](#livestream_service.list_inputs) + * [Livestream_service.start_channel](#livestream_service.start_channel) + * [Livestream_service.stop_channel](#livestream_service.stop_channel) + * [Livestream_service.update_channel](#livestream_service.update_channel) + * [Livestream_service.update_input](#livestream_service.update_input) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Livestream_service.create_channel + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js` + + +----- + + + + +### Livestream_service.create_event + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js` + + +----- + + + + +### Livestream_service.create_input + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js` + + +----- + + + + +### Livestream_service.delete_channel + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js` + + +----- + + + + +### Livestream_service.delete_event + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js` + + +----- + + + + +### Livestream_service.delete_input + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js` + + +----- + + + + +### Livestream_service.get_channel + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js` + + +----- + + + + +### Livestream_service.get_event + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js` + + +----- + + + + +### Livestream_service.get_input + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js` + + +----- + + + + +### Livestream_service.list_channels + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js` + + +----- + + + + +### Livestream_service.list_events + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js` + + +----- + + + + +### Livestream_service.list_inputs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js` + + +----- + + + + +### Livestream_service.start_channel + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js` + + +----- + + + + +### Livestream_service.stop_channel + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js` + + +----- + + + + +### Livestream_service.update_channel + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js` + + +----- + + + + +### Livestream_service.update_input + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-livestream/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-livestream/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-video-livestream/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/livestream/ diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js new file mode 100644 index 00000000000..edbc887cda1 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_channel.js @@ -0,0 +1,89 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, channel, channelId) { + // [START livestream_v1_generated_LivestreamService_CreateChannel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The channel resource to be created. + */ + // const channel = {} + /** + * Required. The ID of the channel resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + */ + // const channelId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callCreateChannel() { + // Construct request + const request = { + parent, + channel, + channelId, + }; + + // Run request + const [operation] = await livestreamClient.createChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateChannel(); + // [END livestream_v1_generated_LivestreamService_CreateChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js new file mode 100644 index 00000000000..a103f8d9214 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_event.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, event, eventId) { + // [START livestream_v1_generated_LivestreamService_CreateEvent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const parent = 'abc123' + /** + * Required. The event resource to be created. + */ + // const event = {} + /** + * Required. The ID of the event resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + */ + // const eventId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callCreateEvent() { + // Construct request + const request = { + parent, + event, + eventId, + }; + + // Run request + const response = await livestreamClient.createEvent(request); + console.log(response); + } + + callCreateEvent(); + // [END livestream_v1_generated_LivestreamService_CreateEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js new file mode 100644 index 00000000000..60ce3f76455 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.create_input.js @@ -0,0 +1,89 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, input, inputId) { + // [START livestream_v1_generated_LivestreamService_CreateInput_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The input resource to be created. + */ + // const input = {} + /** + * Required. The ID of the input resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + */ + // const inputId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callCreateInput() { + // Construct request + const request = { + parent, + input, + inputId, + }; + + // Run request + const [operation] = await livestreamClient.createInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInput(); + // [END livestream_v1_generated_LivestreamService_CreateInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js new file mode 100644 index 00000000000..fc8b0c54058 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_channel.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_DeleteChannel_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 channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + /** + * If the `force` field is set to the default value of `false`, you must + * delete all of a channel's events before you can delete the channel itself. + * If the field is set to `true`, requests to delete a channel also delete + * associated channel events. + */ + // const force = true + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callDeleteChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.deleteChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteChannel(); + // [END livestream_v1_generated_LivestreamService_DeleteChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js new file mode 100644 index 00000000000..bc61ccdb614 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_event.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_DeleteEvent_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 event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callDeleteEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.deleteEvent(request); + console.log(response); + } + + callDeleteEvent(); + // [END livestream_v1_generated_LivestreamService_DeleteEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js new file mode 100644 index 00000000000..3ae6959ffc4 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.delete_input.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_DeleteInput_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 input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callDeleteInput() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.deleteInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInput(); + // [END livestream_v1_generated_LivestreamService_DeleteInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js new file mode 100644 index 00000000000..af244ca0fc1 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_channel.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_GetChannel_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 channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callGetChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.getChannel(request); + console.log(response); + } + + callGetChannel(); + // [END livestream_v1_generated_LivestreamService_GetChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js new file mode 100644 index 00000000000..0ffa36446c1 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_event.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_GetEvent_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 event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + */ + // const name = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callGetEvent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.getEvent(request); + console.log(response); + } + + callGetEvent(); + // [END livestream_v1_generated_LivestreamService_GetEvent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js new file mode 100644 index 00000000000..fae9b2278c7 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.get_input.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_GetInput_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 input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + */ + // const name = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callGetInput() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await livestreamClient.getInput(request); + console.log(response); + } + + callGetInput(); + // [END livestream_v1_generated_LivestreamService_GetInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js new file mode 100644 index 00000000000..742ff44683a --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_channels.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START livestream_v1_generated_LivestreamService_ListChannels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token to + * determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListChannels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listChannelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChannels(); + // [END livestream_v1_generated_LivestreamService_ListChannels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js new file mode 100644 index 00000000000..c307401ab60 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_events.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START livestream_v1_generated_LivestreamService_ListEvents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListEventsResponse.next_page_token to + * determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListEvents() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listEventsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvents(); + // [END livestream_v1_generated_LivestreamService_ListEvents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js new file mode 100644 index 00000000000..022c0cb1cd1 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.list_inputs.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START livestream_v1_generated_LivestreamService_ListInputs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListInputsResponse.next_page_token to + * determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at Sorting + * Order (https://cloud.google.com/apis/design/design_patterns#sorting_order). + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListInputs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listInputsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInputs(); + // [END livestream_v1_generated_LivestreamService_ListInputs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js new file mode 100644 index 00000000000..3f0edd3220e --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.start_channel.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_StartChannel_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 channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callStartChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.startChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartChannel(); + // [END livestream_v1_generated_LivestreamService_StartChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js new file mode 100644 index 00000000000..d7b3c1dd3d5 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.stop_channel.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START livestream_v1_generated_LivestreamService_StopChannel_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 channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callStopChannel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await livestreamClient.stopChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopChannel(); + // [END livestream_v1_generated_LivestreamService_StopChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js new file mode 100644 index 00000000000..436e6e8eee9 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_channel.js @@ -0,0 +1,89 @@ +// 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(channel) { + // [START livestream_v1_generated_LivestreamService_UpdateChannel_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the Channel + * resource by the update. You can only update the following fields: + * * `inputAttachments` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * `output` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + * * `elementaryStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * `muxStreams` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + * * `manifests` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) + * * `spritesheets` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + */ + // const updateMask = {} + /** + * Required. The channel resource to be updated. + */ + // const channel = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callUpdateChannel() { + // Construct request + const request = { + channel, + }; + + // Run request + const [operation] = await livestreamClient.updateChannel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateChannel(); + // [END livestream_v1_generated_LivestreamService_UpdateChannel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js new file mode 100644 index 00000000000..035685687f6 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/livestream_service.update_input.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(input) { + // [START livestream_v1_generated_LivestreamService_UpdateInput_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the Input + * resource by the update. You can only update the following fields: + * * `preprocessingConfig` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + * * `securityRules` (https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + */ + // const updateMask = {} + /** + * Required. The input resource to be updated. + */ + // const input = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + */ + // const requestId = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callUpdateInput() { + // Construct request + const request = { + input, + }; + + // Run request + const [operation] = await livestreamClient.updateInput(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInput(); + // [END livestream_v1_generated_LivestreamService_UpdateInput_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json b/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json new file mode 100644 index 00000000000..45793d38d56 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/generated/v1/snippet_metadata.google.cloud.video.livestream.v1.json @@ -0,0 +1,779 @@ +{ + "clientLibrary": { + "name": "nodejs-livestream", + "version": "0.3.4", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.video.livestream.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "livestream_v1_generated_LivestreamService_CreateChannel_async", + "title": "LivestreamService createChannel Sample", + "origin": "API_DEFINITION", + "description": " Creates a channel with the provided unique ID in the specified region.", + "canonical": true, + "file": "livestream_service.create_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "channel", + "type": ".google.cloud.video.livestream.v1.Channel" + }, + { + "name": "channel_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "CreateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_ListChannels_async", + "title": "LivestreamService listChannels Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all channels in the specified region.", + "canonical": true, + "file": "livestream_service.list_channels.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChannels", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.ListChannelsResponse", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "ListChannels", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_GetChannel_async", + "title": "LivestreamService getChannel Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified channel.", + "canonical": true, + "file": "livestream_service.get_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Channel", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "GetChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_DeleteChannel_async", + "title": "LivestreamService deleteChannel Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified channel.", + "canonical": true, + "file": "livestream_service.delete_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "DeleteChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_UpdateChannel_async", + "title": "LivestreamService updateChannel Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified channel.", + "canonical": true, + "file": "livestream_service.update_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "channel", + "type": ".google.cloud.video.livestream.v1.Channel" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "UpdateChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_StartChannel_async", + "title": "LivestreamService startChannel Sample", + "origin": "API_DEFINITION", + "description": " Starts the specified channel. Part of the video pipeline will be created only when the StartChannel request is received by the server.", + "canonical": true, + "file": "livestream_service.start_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "StartChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_StopChannel_async", + "title": "LivestreamService stopChannel Sample", + "origin": "API_DEFINITION", + "description": " Stops the specified channel. Part of the video pipeline will be released when the StopChannel request is received by the server.", + "canonical": true, + "file": "livestream_service.stop_channel.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "StopChannel", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_CreateInput_async", + "title": "LivestreamService createInput Sample", + "origin": "API_DEFINITION", + "description": " Creates an input with the provided unique ID in the specified region.", + "canonical": true, + "file": "livestream_service.create_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "input", + "type": ".google.cloud.video.livestream.v1.Input" + }, + { + "name": "input_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "CreateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_ListInputs_async", + "title": "LivestreamService listInputs Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all inputs in the specified region.", + "canonical": true, + "file": "livestream_service.list_inputs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInputs", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.ListInputsResponse", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "ListInputs", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_GetInput_async", + "title": "LivestreamService getInput Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified input.", + "canonical": true, + "file": "livestream_service.get_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetInput", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Input", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "GetInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_DeleteInput_async", + "title": "LivestreamService deleteInput Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified input.", + "canonical": true, + "file": "livestream_service.delete_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "DeleteInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_UpdateInput_async", + "title": "LivestreamService updateInput Sample", + "origin": "API_DEFINITION", + "description": " Updates the specified input.", + "canonical": true, + "file": "livestream_service.update_input.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "input", + "type": ".google.cloud.video.livestream.v1.Input" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "UpdateInput", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_CreateEvent_async", + "title": "LivestreamService createEvent Sample", + "origin": "API_DEFINITION", + "description": " Creates an event with the provided unique ID in the specified channel.", + "canonical": true, + "file": "livestream_service.create_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "event", + "type": ".google.cloud.video.livestream.v1.Event" + }, + { + "name": "event_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Event", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "CreateEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_ListEvents_async", + "title": "LivestreamService listEvents Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of all events in the specified channel.", + "canonical": true, + "file": "livestream_service.list_events.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvents", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.ListEventsResponse", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "ListEvents", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_GetEvent_async", + "title": "LivestreamService getEvent Sample", + "origin": "API_DEFINITION", + "description": " Returns the specified event.", + "canonical": true, + "file": "livestream_service.get_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.livestream.v1.Event", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "GetEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + }, + { + "regionTag": "livestream_v1_generated_LivestreamService_DeleteEvent_async", + "title": "LivestreamService deleteEvent Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified event.", + "canonical": true, + "file": "livestream_service.delete_event.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "LivestreamServiceClient", + "fullName": "google.cloud.video.livestream.v1.LivestreamServiceClient" + }, + "method": { + "shortName": "DeleteEvent", + "fullName": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", + "service": { + "shortName": "LivestreamService", + "fullName": "google.cloud.video.livestream.v1.LivestreamService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-video-livestream/samples/package.json b/packages/google-cloud-video-livestream/samples/package.json new file mode 100644 index 00000000000..df930d216e5 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "nodejs-video-live-stream", + "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/livestream": "^0.3.4" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^9.0.0", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-cloud-video-livestream/samples/quickstart.js b/packages/google-cloud-video-livestream/samples/quickstart.js new file mode 100644 index 00000000000..c5f337ba581 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/quickstart.js @@ -0,0 +1,76 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START livestream_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token to + * determine if there are more items left to be queried. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Livestream library + const {LivestreamServiceClient} = require('@google-cloud/livestream').v1; + + // Instantiates a client + const livestreamClient = new LivestreamServiceClient(); + + async function callListChannels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await livestreamClient.listChannelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChannels(); + // [END livestream_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-livestream/samples/test/quickstart.js b/packages/google-cloud-video-livestream/samples/test/quickstart.js new file mode 100644 index 00000000000..0d0a89be236 --- /dev/null +++ b/packages/google-cloud-video-livestream/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// 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'; + +// const path = require('path'); +// const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// const {LivestreamServiceClient} = require('@google-cloud/vmmigration').v1; + +// const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +// const cwd = path.join(__dirname, '..'); + +// const client = new LivestreamServiceClient(); + +describe('Quickstart', () => { + // let projectId; + + before(async () => { + // projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + // API must be allow listed: + // Should have 0 exit code, and therefore not throw: + // execSync(`node ./quickstart.js projects/${projectId}/locations/global`, { + // cwd, + // }); + }); +}); diff --git a/packages/google-cloud-video-livestream/src/index.ts b/packages/google-cloud-video-livestream/src/index.ts new file mode 100644 index 00000000000..61946656e47 --- /dev/null +++ b/packages/google-cloud-video-livestream/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const LivestreamServiceClient = v1.LivestreamServiceClient; +type LivestreamServiceClient = v1.LivestreamServiceClient; + +export {v1, LivestreamServiceClient}; +export default {v1, LivestreamServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-video-livestream/src/v1/gapic_metadata.json b/packages/google-cloud-video-livestream/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..7e4e701773a --- /dev/null +++ b/packages/google-cloud-video-livestream/src/v1/gapic_metadata.json @@ -0,0 +1,195 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.video.livestream.v1", + "libraryPackage": "@google-cloud/livestream", + "services": { + "LivestreamService": { + "clients": { + "grpc": { + "libraryClient": "LivestreamServiceClient", + "rpcs": { + "GetChannel": { + "methods": [ + "getChannel" + ] + }, + "GetInput": { + "methods": [ + "getInput" + ] + }, + "CreateEvent": { + "methods": [ + "createEvent" + ] + }, + "GetEvent": { + "methods": [ + "getEvent" + ] + }, + "DeleteEvent": { + "methods": [ + "deleteEvent" + ] + }, + "CreateChannel": { + "methods": [ + "createChannel" + ] + }, + "DeleteChannel": { + "methods": [ + "deleteChannel" + ] + }, + "UpdateChannel": { + "methods": [ + "updateChannel" + ] + }, + "StartChannel": { + "methods": [ + "startChannel" + ] + }, + "StopChannel": { + "methods": [ + "stopChannel" + ] + }, + "CreateInput": { + "methods": [ + "createInput" + ] + }, + "DeleteInput": { + "methods": [ + "deleteInput" + ] + }, + "UpdateInput": { + "methods": [ + "updateInput" + ] + }, + "ListChannels": { + "methods": [ + "listChannels", + "listChannelsStream", + "listChannelsAsync" + ] + }, + "ListInputs": { + "methods": [ + "listInputs", + "listInputsStream", + "listInputsAsync" + ] + }, + "ListEvents": { + "methods": [ + "listEvents", + "listEventsStream", + "listEventsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LivestreamServiceClient", + "rpcs": { + "GetChannel": { + "methods": [ + "getChannel" + ] + }, + "GetInput": { + "methods": [ + "getInput" + ] + }, + "CreateEvent": { + "methods": [ + "createEvent" + ] + }, + "GetEvent": { + "methods": [ + "getEvent" + ] + }, + "DeleteEvent": { + "methods": [ + "deleteEvent" + ] + }, + "CreateChannel": { + "methods": [ + "createChannel" + ] + }, + "DeleteChannel": { + "methods": [ + "deleteChannel" + ] + }, + "UpdateChannel": { + "methods": [ + "updateChannel" + ] + }, + "StartChannel": { + "methods": [ + "startChannel" + ] + }, + "StopChannel": { + "methods": [ + "stopChannel" + ] + }, + "CreateInput": { + "methods": [ + "createInput" + ] + }, + "DeleteInput": { + "methods": [ + "deleteInput" + ] + }, + "UpdateInput": { + "methods": [ + "updateInput" + ] + }, + "ListChannels": { + "methods": [ + "listChannels", + "listChannelsStream", + "listChannelsAsync" + ] + }, + "ListInputs": { + "methods": [ + "listInputs", + "listInputsStream", + "listInputsAsync" + ] + }, + "ListEvents": { + "methods": [ + "listEvents", + "listEventsStream", + "listEventsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-video-livestream/src/v1/index.ts b/packages/google-cloud-video-livestream/src/v1/index.ts new file mode 100644 index 00000000000..c8ed1f8ba4b --- /dev/null +++ b/packages/google-cloud-video-livestream/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 {LivestreamServiceClient} from './livestream_service_client'; diff --git a/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts b/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts new file mode 100644 index 00000000000..c86a71f6ff6 --- /dev/null +++ b/packages/google-cloud-video-livestream/src/v1/livestream_service_client.ts @@ -0,0 +1,3164 @@ +// 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/livestream_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './livestream_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Using Live Stream API, you can generate live streams in the various + * renditions and streaming formats. The streaming format include HTTP Live + * Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + * a source stream in the various ways, including Real-Time Messaging + * Protocol (RTMP) and Secure Reliable Transport (SRT). + * @class + * @memberof v1 + */ +export class LivestreamServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + livestreamServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LivestreamServiceClient. + * + * @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 LivestreamServiceClient({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 LivestreamServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + channelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/channels/{channel}' + ), + eventPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/channels/{channel}/events/{event}' + ), + inputPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/inputs/{input}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listChannels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'channels' + ), + listInputs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'inputs' + ), + listEvents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'events' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Channel' + ) as gax.protobuf.Type; + const createChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteChannelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Channel' + ) as gax.protobuf.Type; + const updateChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const startChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.ChannelOperationResponse' + ) as gax.protobuf.Type; + const startChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const stopChannelResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.ChannelOperationResponse' + ) as gax.protobuf.Type; + const stopChannelMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createInputResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Input' + ) as gax.protobuf.Type; + const createInputMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInputResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInputMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateInputResponse = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.Input' + ) as gax.protobuf.Type; + const updateInputMetadata = protoFilesRoot.lookup( + '.google.cloud.video.livestream.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createChannelResponse.decode.bind(createChannelResponse), + createChannelMetadata.decode.bind(createChannelMetadata) + ), + deleteChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteChannelResponse.decode.bind(deleteChannelResponse), + deleteChannelMetadata.decode.bind(deleteChannelMetadata) + ), + updateChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateChannelResponse.decode.bind(updateChannelResponse), + updateChannelMetadata.decode.bind(updateChannelMetadata) + ), + startChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startChannelResponse.decode.bind(startChannelResponse), + startChannelMetadata.decode.bind(startChannelMetadata) + ), + stopChannel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopChannelResponse.decode.bind(stopChannelResponse), + stopChannelMetadata.decode.bind(stopChannelMetadata) + ), + createInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInputResponse.decode.bind(createInputResponse), + createInputMetadata.decode.bind(createInputMetadata) + ), + deleteInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInputResponse.decode.bind(deleteInputResponse), + deleteInputMetadata.decode.bind(deleteInputMetadata) + ), + updateInput: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInputResponse.decode.bind(updateInputResponse), + updateInputMetadata.decode.bind(updateInputMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.video.livestream.v1.LivestreamService', + 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.livestreamServiceStub) { + return this.livestreamServiceStub; + } + + // Put together the "service stub" for + // google.cloud.video.livestream.v1.LivestreamService. + this.livestreamServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.video.livestream.v1.LivestreamService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.video.livestream.v1 + .LivestreamService, + 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 livestreamServiceStubMethods = [ + 'createChannel', + 'listChannels', + 'getChannel', + 'deleteChannel', + 'updateChannel', + 'startChannel', + 'stopChannel', + 'createInput', + 'listInputs', + 'getInput', + 'deleteInput', + 'updateInput', + 'createEvent', + 'listEvents', + 'getEvent', + 'deleteEvent', + ]; + for (const methodName of livestreamServiceStubMethods) { + const callPromise = this.livestreamServiceStub.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.livestreamServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'livestream.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 'livestream.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @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 [Channel]{@link google.cloud.video.livestream.v1.Channel}. + * 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/livestream_service.get_channel.js + * region_tag:livestream_v1_generated_LivestreamService_GetChannel_async + */ + getChannel( + request?: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest | undefined, + {} | undefined + ] + >; + getChannel( + request: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IChannel, + | protos.google.cloud.video.livestream.v1.IGetChannelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChannel( + request: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IChannel, + | protos.google.cloud.video.livestream.v1.IGetChannelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChannel( + request?: protos.google.cloud.video.livestream.v1.IGetChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.livestream.v1.IChannel, + | protos.google.cloud.video.livestream.v1.IGetChannelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IChannel, + | protos.google.cloud.video.livestream.v1.IGetChannelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IGetChannelRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getChannel(request, options, callback); + } + /** + * Returns the specified input. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + * @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 [Input]{@link google.cloud.video.livestream.v1.Input}. + * 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/livestream_service.get_input.js + * region_tag:livestream_v1_generated_LivestreamService_GetInput_async + */ + getInput( + request?: protos.google.cloud.video.livestream.v1.IGetInputRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest | undefined, + {} | undefined + ] + >; + getInput( + request: protos.google.cloud.video.livestream.v1.IGetInputRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IInput, + | protos.google.cloud.video.livestream.v1.IGetInputRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInput( + request: protos.google.cloud.video.livestream.v1.IGetInputRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IInput, + | protos.google.cloud.video.livestream.v1.IGetInputRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInput( + request?: protos.google.cloud.video.livestream.v1.IGetInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.livestream.v1.IInput, + | protos.google.cloud.video.livestream.v1.IGetInputRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IInput, + | protos.google.cloud.video.livestream.v1.IGetInputRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IGetInputRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getInput(request, options, callback); + } + /** + * Creates an event with the provided unique ID in the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {google.cloud.video.livestream.v1.Event} request.event + * Required. The event resource to be created. + * @param {string} request.eventId + * Required. The ID of the event resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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 [Event]{@link google.cloud.video.livestream.v1.Event}. + * 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/livestream_service.create_event.js + * region_tag:livestream_v1_generated_LivestreamService_CreateEvent_async + */ + createEvent( + request?: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest | undefined, + {} | undefined + ] + >; + createEvent( + request: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.ICreateEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createEvent( + request: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.ICreateEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createEvent( + request?: protos.google.cloud.video.livestream.v1.ICreateEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.ICreateEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.ICreateEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.ICreateEventRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createEvent(request, options, callback); + } + /** + * Returns the specified event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + * @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 [Event]{@link google.cloud.video.livestream.v1.Event}. + * 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/livestream_service.get_event.js + * region_tag:livestream_v1_generated_LivestreamService_GetEvent_async + */ + getEvent( + request?: protos.google.cloud.video.livestream.v1.IGetEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest | undefined, + {} | undefined + ] + >; + getEvent( + request: protos.google.cloud.video.livestream.v1.IGetEventRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.IGetEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEvent( + request: protos.google.cloud.video.livestream.v1.IGetEventRequest, + callback: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.IGetEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEvent( + request?: protos.google.cloud.video.livestream.v1.IGetEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.IGetEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.livestream.v1.IEvent, + | protos.google.cloud.video.livestream.v1.IGetEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IEvent, + protos.google.cloud.video.livestream.v1.IGetEventRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEvent(request, options, callback); + } + /** + * Deletes the specified event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the event resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/livestream_service.delete_event.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteEvent_async + */ + deleteEvent( + request?: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest | undefined, + {} | undefined + ] + >; + deleteEvent( + request: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.livestream.v1.IDeleteEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteEvent( + request: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.livestream.v1.IDeleteEventRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteEvent( + request?: protos.google.cloud.video.livestream.v1.IDeleteEventRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.livestream.v1.IDeleteEventRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.livestream.v1.IDeleteEventRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IDeleteEventRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteEvent(request, options, callback); + } + + /** + * Creates a channel with the provided unique ID in the specified + * region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.video.livestream.v1.Channel} request.channel + * Required. The channel resource to be created. + * @param {string} request.channelId + * Required. The ID of the channel resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.create_channel.js + * region_tag:livestream_v1_generated_LivestreamService_CreateChannel_async + */ + createChannel( + request?: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createChannel( + request: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createChannel( + request: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createChannel( + request?: protos.google.cloud.video.livestream.v1.ICreateChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createChannel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createChannel()`. + * @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/livestream_service.create_channel.js + * region_tag:livestream_v1_generated_LivestreamService_CreateChannel_async + */ + async checkCreateChannelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.livestream.v1.Channel, + protos.google.cloud.video.livestream.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.createChannel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.livestream.v1.Channel, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Deletes the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {boolean} request.force + * If the `force` field is set to the default value of `false`, you must + * delete all of a channel's events before you can delete the channel itself. + * If the field is set to `true`, requests to delete a channel also delete + * associated channel events. + * @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/livestream_service.delete_channel.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteChannel_async + */ + deleteChannel( + request?: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteChannel( + request: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteChannel( + request: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteChannel( + request?: protos.google.cloud.video.livestream.v1.IDeleteChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteChannel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteChannel()`. + * @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/livestream_service.delete_channel.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteChannel_async + */ + async checkDeleteChannelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.livestream.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.deleteChannel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Updates the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the Channel + * resource by the update. You can only update the following fields: + * + * * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + * * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + * * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#ElementaryStream) + * * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + * * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#Manifest) + * * [`spritesheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + * + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * @param {google.cloud.video.livestream.v1.Channel} request.channel + * Required. The channel resource to be updated. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.update_channel.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateChannel_async + */ + updateChannel( + request?: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateChannel( + request: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateChannel( + request: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateChannel( + request?: protos.google.cloud.video.livestream.v1.IUpdateChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.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({ + 'channel.name': request.channel!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateChannel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateChannel()`. + * @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/livestream_service.update_channel.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateChannel_async + */ + async checkUpdateChannelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.livestream.v1.Channel, + protos.google.cloud.video.livestream.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.updateChannel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.livestream.v1.Channel, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Starts the specified channel. Part of the video pipeline will be created + * only when the StartChannel request is received by the server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.start_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StartChannel_async + */ + startChannel( + request?: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + startChannel( + request: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startChannel( + request: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startChannel( + request?: protos.google.cloud.video.livestream.v1.IStartChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.startChannel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `startChannel()`. + * @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/livestream_service.start_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StartChannel_async + */ + async checkStartChannelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.livestream.v1.ChannelOperationResponse, + protos.google.cloud.video.livestream.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.startChannel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.livestream.v1.ChannelOperationResponse, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Stops the specified channel. Part of the video pipeline will be released + * when the StopChannel request is received by the server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the channel resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.stop_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StopChannel_async + */ + stopChannel( + request?: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + stopChannel( + request: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + stopChannel( + request: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + stopChannel( + request?: protos.google.cloud.video.livestream.v1.IStopChannelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.stopChannel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `stopChannel()`. + * @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/livestream_service.stop_channel.js + * region_tag:livestream_v1_generated_LivestreamService_StopChannel_async + */ + async checkStopChannelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.livestream.v1.ChannelOperationResponse, + protos.google.cloud.video.livestream.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.stopChannel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.livestream.v1.ChannelOperationResponse, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Creates an input with the provided unique ID in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.video.livestream.v1.Input} request.input + * Required. The input resource to be created. + * @param {string} request.inputId + * Required. The ID of the input resource to be created. + * This value must be 1-63 characters, begin and end with `[a-z0-9]`, + * could contain dashes (-) in between. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.create_input.js + * region_tag:livestream_v1_generated_LivestreamService_CreateInput_async + */ + createInput( + request?: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInput( + request: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInput( + request: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInput( + request?: protos.google.cloud.video.livestream.v1.ICreateInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createInput(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInput()`. + * @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/livestream_service.create_input.js + * region_tag:livestream_v1_generated_LivestreamService_CreateInput_async + */ + async checkCreateInputProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.livestream.v1.Input, + protos.google.cloud.video.livestream.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.createInput, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.livestream.v1.Input, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Deletes the specified input. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the input resource, in the form of: + * `projects/{project}/locations/{location}/inputs/{inputId}`. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.delete_input.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteInput_async + */ + deleteInput( + request?: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInput( + request: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInput( + request: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInput( + request?: protos.google.cloud.video.livestream.v1.IDeleteInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteInput(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInput()`. + * @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/livestream_service.delete_input.js + * region_tag:livestream_v1_generated_LivestreamService_DeleteInput_async + */ + async checkDeleteInputProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.livestream.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.deleteInput, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Updates the specified input. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the Input + * resource by the update. You can only update the following fields: + * + * * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + * * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + * + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * @param {google.cloud.video.livestream.v1.Input} request.input + * Required. The input resource to be updated. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was + * received, and if so, will ignore the second request. This prevents clients + * from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported `(00000000-0000-0000-0000-000000000000)`. + * @param {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/livestream_service.update_input.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateInput_async + */ + updateInput( + request?: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInput( + request: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInput( + request: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + callback: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInput( + request?: protos.google.cloud.video.livestream.v1.IUpdateInputRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.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({ + 'input.name': request.input!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateInput(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateInput()`. + * @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/livestream_service.update_input.js + * region_tag:livestream_v1_generated_LivestreamService_UpdateInput_async + */ + async checkUpdateInputProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.video.livestream.v1.Input, + protos.google.cloud.video.livestream.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.updateInput, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.video.livestream.v1.Input, + protos.google.cloud.video.livestream.v1.OperationMetadata + >; + } + /** + * Returns a list of all channels in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [Channel]{@link google.cloud.video.livestream.v1.Channel}. + * 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 `listChannelsAsync()` + * 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. + */ + listChannels( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IChannel[], + protos.google.cloud.video.livestream.v1.IListChannelsRequest | null, + protos.google.cloud.video.livestream.v1.IListChannelsResponse + ] + >; + listChannels( + request: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + | protos.google.cloud.video.livestream.v1.IListChannelsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IChannel + > + ): void; + listChannels( + request: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + | protos.google.cloud.video.livestream.v1.IListChannelsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IChannel + > + ): void; + listChannels( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + | protos.google.cloud.video.livestream.v1.IListChannelsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IChannel + >, + callback?: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListChannelsRequest, + | protos.google.cloud.video.livestream.v1.IListChannelsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IChannel + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IChannel[], + protos.google.cloud.video.livestream.v1.IListChannelsRequest | null, + protos.google.cloud.video.livestream.v1.IListChannelsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listChannels(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [Channel]{@link google.cloud.video.livestream.v1.Channel} 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 `listChannelsAsync()` + * 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. + */ + listChannelsStream( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChannels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannels.createStream( + this.innerApiCalls.listChannels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listChannels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListChannelsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [Channel]{@link google.cloud.video.livestream.v1.Channel}. 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/livestream_service.list_channels.js + * region_tag:livestream_v1_generated_LivestreamService_ListChannels_async + */ + listChannelsAsync( + request?: protos.google.cloud.video.livestream.v1.IListChannelsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChannels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannels.asyncIterate( + this.innerApiCalls['listChannels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all inputs in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at [Sorting + * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @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 [Input]{@link google.cloud.video.livestream.v1.Input}. + * 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 `listInputsAsync()` + * 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. + */ + listInputs( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IInput[], + protos.google.cloud.video.livestream.v1.IListInputsRequest | null, + protos.google.cloud.video.livestream.v1.IListInputsResponse + ] + >; + listInputs( + request: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + | protos.google.cloud.video.livestream.v1.IListInputsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IInput + > + ): void; + listInputs( + request: protos.google.cloud.video.livestream.v1.IListInputsRequest, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + | protos.google.cloud.video.livestream.v1.IListInputsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IInput + > + ): void; + listInputs( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + | protos.google.cloud.video.livestream.v1.IListInputsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IInput + >, + callback?: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListInputsRequest, + | protos.google.cloud.video.livestream.v1.IListInputsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IInput + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IInput[], + protos.google.cloud.video.livestream.v1.IListInputsRequest | null, + protos.google.cloud.video.livestream.v1.IListInputsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listInputs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at [Sorting + * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @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 [Input]{@link google.cloud.video.livestream.v1.Input} 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 `listInputsAsync()` + * 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. + */ + listInputsStream( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInputs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInputs.createStream( + this.innerApiCalls.listInputs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInputs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location for the resource, in the form of: + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListInputsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at [Sorting + * Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + * @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 + * [Input]{@link google.cloud.video.livestream.v1.Input}. 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/livestream_service.list_inputs.js + * region_tag:livestream_v1_generated_LivestreamService_ListInputs_async + */ + listInputsAsync( + request?: protos.google.cloud.video.livestream.v1.IListInputsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInputs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInputs.asyncIterate( + this.innerApiCalls['listInputs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns a list of all events in the specified channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [Event]{@link google.cloud.video.livestream.v1.Event}. + * 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 `listEventsAsync()` + * 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. + */ + listEvents( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IEvent[], + protos.google.cloud.video.livestream.v1.IListEventsRequest | null, + protos.google.cloud.video.livestream.v1.IListEventsResponse + ] + >; + listEvents( + request: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + | protos.google.cloud.video.livestream.v1.IListEventsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IEvent + > + ): void; + listEvents( + request: protos.google.cloud.video.livestream.v1.IListEventsRequest, + callback: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + | protos.google.cloud.video.livestream.v1.IListEventsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IEvent + > + ): void; + listEvents( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + | protos.google.cloud.video.livestream.v1.IListEventsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IEvent + >, + callback?: PaginationCallback< + protos.google.cloud.video.livestream.v1.IListEventsRequest, + | protos.google.cloud.video.livestream.v1.IListEventsResponse + | null + | undefined, + protos.google.cloud.video.livestream.v1.IEvent + > + ): Promise< + [ + protos.google.cloud.video.livestream.v1.IEvent[], + protos.google.cloud.video.livestream.v1.IListEventsRequest | null, + protos.google.cloud.video.livestream.v1.IListEventsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listEvents(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [Event]{@link google.cloud.video.livestream.v1.Event} 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 `listEventsAsync()` + * 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. + */ + listEventsStream( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEvents.createStream( + this.innerApiCalls.listEvents as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEvents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent channel for the resource, in the form of: + * `projects/{project}/locations/{location}/channels/{channelId}`. + * @param {number} request.pageSize + * The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.video.livestream.v1.ListEventsResponse.next_page_token|next_page_token} to + * determine if there are more items left to be queried. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {string} request.filter + * The filter to apply to list results. + * @param {string} request.orderBy + * Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [Event]{@link google.cloud.video.livestream.v1.Event}. 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/livestream_service.list_events.js + * region_tag:livestream_v1_generated_LivestreamService_ListEvents_async + */ + listEventsAsync( + request?: protos.google.cloud.video.livestream.v1.IListEventsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEvents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEvents.asyncIterate( + this.innerApiCalls['listEvents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified channel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} channel + * @returns {string} Resource name string. + */ + channelPath(project: string, location: string, channel: string) { + return this.pathTemplates.channelPathTemplate.render({ + project: project, + location: location, + channel: channel, + }); + } + + /** + * Parse the project from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).project; + } + + /** + * Parse the location from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).location; + } + + /** + * Parse the channel from Channel resource. + * + * @param {string} channelName + * A fully-qualified path representing Channel resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromChannelName(channelName: string) { + return this.pathTemplates.channelPathTemplate.match(channelName).channel; + } + + /** + * Return a fully-qualified event resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} channel + * @param {string} event + * @returns {string} Resource name string. + */ + eventPath(project: string, location: string, channel: string, event: string) { + return this.pathTemplates.eventPathTemplate.render({ + project: project, + location: location, + channel: channel, + event: event, + }); + } + + /** + * Parse the project from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).project; + } + + /** + * Parse the location from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).location; + } + + /** + * Parse the channel from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the channel. + */ + matchChannelFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).channel; + } + + /** + * Parse the event from Event resource. + * + * @param {string} eventName + * A fully-qualified path representing Event resource. + * @returns {string} A string representing the event. + */ + matchEventFromEventName(eventName: string) { + return this.pathTemplates.eventPathTemplate.match(eventName).event; + } + + /** + * Return a fully-qualified input resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} input + * @returns {string} Resource name string. + */ + inputPath(project: string, location: string, input: string) { + return this.pathTemplates.inputPathTemplate.render({ + project: project, + location: location, + input: input, + }); + } + + /** + * Parse the project from Input resource. + * + * @param {string} inputName + * A fully-qualified path representing Input resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInputName(inputName: string) { + return this.pathTemplates.inputPathTemplate.match(inputName).project; + } + + /** + * Parse the location from Input resource. + * + * @param {string} inputName + * A fully-qualified path representing Input resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInputName(inputName: string) { + return this.pathTemplates.inputPathTemplate.match(inputName).location; + } + + /** + * Parse the input from Input resource. + * + * @param {string} inputName + * A fully-qualified path representing Input resource. + * @returns {string} A string representing the input. + */ + matchInputFromInputName(inputName: string) { + return this.pathTemplates.inputPathTemplate.match(inputName).input; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.livestreamServiceStub && !this._terminated) { + return this.livestreamServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-video-livestream/src/v1/livestream_service_client_config.json b/packages/google-cloud-video-livestream/src/v1/livestream_service_client_config.json new file mode 100644 index 00000000000..54b1640f293 --- /dev/null +++ b/packages/google-cloud-video-livestream/src/v1/livestream_service_client_config.json @@ -0,0 +1,118 @@ +{ + "interfaces": { + "google.cloud.video.livestream.v1.LivestreamService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListChannels": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetChannel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopChannel": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInput": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInputs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetInput": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteInput": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInput": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEvent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEvents": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetEvent": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteEvent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-video-livestream/src/v1/livestream_service_proto_list.json b/packages/google-cloud-video-livestream/src/v1/livestream_service_proto_list.json new file mode 100644 index 00000000000..59db12abdff --- /dev/null +++ b/packages/google-cloud-video-livestream/src/v1/livestream_service_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/video/livestream/v1/outputs.proto", + "../../protos/google/cloud/video/livestream/v1/resources.proto", + "../../protos/google/cloud/video/livestream/v1/service.proto" +] diff --git a/packages/google-cloud-video-livestream/system-test/fixtures/sample/src/index.js b/packages/google-cloud-video-livestream/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1e217742310 --- /dev/null +++ b/packages/google-cloud-video-livestream/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 livestream = require('@google-cloud/livestream'); + +function main() { + const livestreamServiceClient = new livestream.LivestreamServiceClient(); +} + +main(); diff --git a/packages/google-cloud-video-livestream/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-video-livestream/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..6af93a28936 --- /dev/null +++ b/packages/google-cloud-video-livestream/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 {LivestreamServiceClient} from '@google-cloud/livestream'; + +// check that the client class type name can be used +function doStuffWithLivestreamServiceClient(client: LivestreamServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const livestreamServiceClient = new LivestreamServiceClient(); + doStuffWithLivestreamServiceClient(livestreamServiceClient); +} + +main(); diff --git a/packages/google-cloud-video-livestream/system-test/install.ts b/packages/google-cloud-video-livestream/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-video-livestream/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts b/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts new file mode 100644 index 00000000000..df8fff8b519 --- /dev/null +++ b/packages/google-cloud-video-livestream/test/gapic_livestream_service_v1.ts @@ -0,0 +1,3724 @@ +// 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 livestreamserviceModule 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.LivestreamServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + livestreamserviceModule.v1.LivestreamServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + livestreamserviceModule.v1.LivestreamServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = livestreamserviceModule.v1.LivestreamServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.livestreamServiceStub, undefined); + await client.initialize(); + assert(client.livestreamServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.livestreamServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.livestreamServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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 livestreamserviceModule.v1.LivestreamServiceClient({ + 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('getChannel', () => { + it('invokes getChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ); + client.innerApiCalls.getChannel = stubSimpleCall(expectedResponse); + const [response] = await client.getChannel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ); + client.innerApiCalls.getChannel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChannel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IChannel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannel with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChannel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannel with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getChannel(request), expectedError); + }); + }); + + describe('getInput', () => { + it('invokes getInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ); + client.innerApiCalls.getInput = stubSimpleCall(expectedResponse); + const [response] = await client.getInput(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ); + client.innerApiCalls.getInput = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInput( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IInput | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInput with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInput = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInput(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInput with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInput(request), expectedError); + }); + }); + + describe('createEvent', () => { + it('invokes createEvent without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.createEvent = stubSimpleCall(expectedResponse); + const [response] = await client.createEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.createEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IEvent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEvent with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateEventRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createEvent(request), expectedError); + }); + }); + + describe('getEvent', () => { + it('invokes getEvent without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.getEvent = stubSimpleCall(expectedResponse); + const [response] = await client.getEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ); + client.innerApiCalls.getEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IEvent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvent = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvent with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.GetEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.GetEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEvent(request), expectedError); + }); + }); + + describe('deleteEvent', () => { + it('invokes deleteEvent without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvent = stubSimpleCall(expectedResponse); + const [response] = await client.deleteEvent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEvent( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteEvent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEvent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEvent with closed client', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteEventRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteEventRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteEvent(request), expectedError); + }); + }); + + describe('createChannel', () => { + it('invokes createChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateChannelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createChannel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateChannelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createChannel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createChannel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateChannelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChannel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateChannelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChannel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkCreateChannelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkCreateChannelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteChannel', () => { + it('invokes deleteChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteChannel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteChannel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteChannel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteChannel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteChannel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkDeleteChannelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkDeleteChannelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateChannel', () => { + it('invokes updateChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateChannelRequest', + ['channel', 'name'] + ); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateChannel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateChannelRequest', + ['channel', 'name'] + ); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateChannel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateChannel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.livestream.v1.IChannel, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateChannelRequest', + ['channel', 'name'] + ); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChannel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateChannelRequest() + ); + request.channel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateChannelRequest', + ['channel', 'name'] + ); + request.channel.name = defaultValue1; + const expectedHeaderRequestParams = `channel.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChannel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkUpdateChannelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkUpdateChannelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('startChannel', () => { + it('invokes startChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StartChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.startChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StartChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startChannel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startChannel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StartChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startChannel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.startChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StartChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StartChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startChannel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.startChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkStartChannelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkStartChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('stopChannel', () => { + it('invokes stopChannel without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StopChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopChannel = stubLongRunningCall(expectedResponse); + const [operation] = await client.stopChannel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopChannel without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StopChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopChannel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopChannel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.livestream.v1.IChannelOperationResponse, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopChannel with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StopChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopChannel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.stopChannel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopChannel with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.StopChannelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.StopChannelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopChannel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.stopChannel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopChannel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopChannelProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkStopChannelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopChannelProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkStopChannelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createInput', () => { + it('invokes createInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateInputRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInput = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateInputRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInput = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInput( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInput with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateInputRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInput = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInput(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInput with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.CreateInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.CreateInputRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInput = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInputProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkCreateInputProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInputProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkCreateInputProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInput', () => { + it('invokes deleteInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInput = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInput = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInput( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInput with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInput = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInput(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInput with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.DeleteInputRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.DeleteInputRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInput = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInputProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkDeleteInputProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInputProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkDeleteInputProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateInput', () => { + it('invokes updateInput without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateInputRequest', + ['input', 'name'] + ); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInput = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInput(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInput without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateInputRequest', + ['input', 'name'] + ); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInput = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInput( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.video.livestream.v1.IInput, + protos.google.cloud.video.livestream.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInput with call error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateInputRequest', + ['input', 'name'] + ); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInput = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateInput(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInput with LRO error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.UpdateInputRequest() + ); + request.input ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.UpdateInputRequest', + ['input', 'name'] + ); + request.input.name = defaultValue1; + const expectedHeaderRequestParams = `input.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInput = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateInput(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInput as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInputProgress without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkUpdateInputProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInputProgress with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + 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.checkUpdateInputProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listChannels', () => { + it('invokes listChannels without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + ]; + client.innerApiCalls.listChannels = stubSimpleCall(expectedResponse); + const [response] = await client.listChannels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChannels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannels without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + ]; + client.innerApiCalls.listChannels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChannels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IChannel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChannels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannels with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChannels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listChannels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listChannels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelsStream without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + ]; + client.descriptors.page.listChannels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listChannelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Channel[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.livestream.v1.Channel) => { + 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.listChannels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChannels, request) + ); + assert( + (client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listChannelsStream with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listChannelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Channel[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.livestream.v1.Channel) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChannels, request) + ); + assert( + (client.descriptors.page.listChannels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannels without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Channel() + ), + ]; + client.descriptors.page.listChannels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.livestream.v1.IChannel[] = []; + const iterable = client.listChannelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listChannels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listChannels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannels with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListChannelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListChannelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannels.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChannelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.livestream.v1.IChannel[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listChannels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listChannels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInputs', () => { + it('invokes listInputs without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + ]; + client.innerApiCalls.listInputs = stubSimpleCall(expectedResponse); + const [response] = await client.listInputs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInputs without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + ]; + client.innerApiCalls.listInputs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInputs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IInput[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInputs with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInputs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInputs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInputsStream without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + ]; + client.descriptors.page.listInputs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInputsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Input[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.livestream.v1.Input) => { + 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.listInputs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInputs, request) + ); + assert( + (client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInputsStream with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInputs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listInputsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Input[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.livestream.v1.Input) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInputs, request) + ); + assert( + (client.descriptors.page.listInputs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInputs without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Input() + ), + ]; + client.descriptors.page.listInputs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.livestream.v1.IInput[] = []; + const iterable = client.listInputsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInputs.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listInputs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInputs with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListInputsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListInputsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInputs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listInputsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.livestream.v1.IInput[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInputs.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listInputs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvents', () => { + it('invokes listEvents without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + ]; + client.innerApiCalls.listEvents = stubSimpleCall(expectedResponse); + const [response] = await client.listEvents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvents without error using callback', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + ]; + client.innerApiCalls.listEvents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.livestream.v1.IEvent[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvents with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEvents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEventsStream without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + ]; + client.descriptors.page.listEvents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Event[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.livestream.v1.Event) => { + 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.listEvents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEvents, request) + ); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEventsStream with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvents.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listEventsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.livestream.v1.Event[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.livestream.v1.Event) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEvents, request) + ); + assert( + (client.descriptors.page.listEvents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvents without error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + generateSampleMessage( + new protos.google.cloud.video.livestream.v1.Event() + ), + ]; + client.descriptors.page.listEvents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.livestream.v1.IEvent[] = []; + const iterable = client.listEventsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvents.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvents with error', async () => { + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.livestream.v1.ListEventsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.livestream.v1.ListEventsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvents.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listEventsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.livestream.v1.IEvent[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvents.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listEvents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('channel', () => { + const fakePath = '/rendered/path/channel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + channel: 'channelValue', + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.channelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPath', () => { + const result = client.channelPath( + 'projectValue', + 'locationValue', + 'channelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.channelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromChannelName', () => { + const result = client.matchProjectFromChannelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromChannelName', () => { + const result = client.matchLocationFromChannelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelFromChannelName', () => { + const result = client.matchChannelFromChannelName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.channelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('event', () => { + const fakePath = '/rendered/path/event'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + channel: 'channelValue', + event: 'eventValue', + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.eventPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.eventPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('eventPath', () => { + const result = client.eventPath( + 'projectValue', + 'locationValue', + 'channelValue', + 'eventValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.eventPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEventName', () => { + const result = client.matchProjectFromEventName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEventName', () => { + const result = client.matchLocationFromEventName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelFromEventName', () => { + const result = client.matchChannelFromEventName(fakePath); + assert.strictEqual(result, 'channelValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEventFromEventName', () => { + const result = client.matchEventFromEventName(fakePath); + assert.strictEqual(result, 'eventValue'); + assert( + (client.pathTemplates.eventPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('input', () => { + const fakePath = '/rendered/path/input'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + input: 'inputValue', + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inputPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.inputPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('inputPath', () => { + const result = client.inputPath( + 'projectValue', + 'locationValue', + 'inputValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.inputPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInputName', () => { + const result = client.matchProjectFromInputName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.inputPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInputName', () => { + const result = client.matchLocationFromInputName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.inputPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInputFromInputName', () => { + const result = client.matchInputFromInputName(fakePath); + assert.strictEqual(result, 'inputValue'); + assert( + (client.pathTemplates.inputPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new livestreamserviceModule.v1.LivestreamServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-video-livestream/tsconfig.json b/packages/google-cloud-video-livestream/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-video-livestream/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-video-livestream/webpack.config.js b/packages/google-cloud-video-livestream/webpack.config.js new file mode 100644 index 00000000000..4e91585dd99 --- /dev/null +++ b/packages/google-cloud-video-livestream/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: 'LivestreamService', + filename: './livestream-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index 47e2042174e..366773304cf 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -67,6 +67,7 @@ "packages/google-cloud-talent": {}, "packages/google-cloud-texttospeech": {}, "packages/google-cloud-translate": {}, + "packages/google-cloud-video-livestream": {}, "packages/google-cloud-video-transcoder": {}, "packages/google-cloud-videointelligence": {}, "packages/google-cloud-websecurityscanner": {},