diff --git a/packages/google-cloud-video-transcoder/.eslintignore b/packages/google-cloud-video-transcoder/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-video-transcoder/.eslintrc.json b/packages/google-cloud-video-transcoder/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-video-transcoder/.gitattributes b/packages/google-cloud-video-transcoder/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.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-transcoder/.github/.OwlBot.yaml b/packages/google-cloud-video-transcoder/.github/.OwlBot.yaml new file mode 100644 index 00000000000..76f23c31db7 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/video/transcoder/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-video-transcoder/.gitignore b/packages/google-cloud-video-transcoder/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-video-transcoder/.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-transcoder/.jsdoc.js b/packages/google-cloud-video-transcoder/.jsdoc.js new file mode 100644 index 00000000000..1c49b86a300 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.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/video-transcoder', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-video-transcoder/.mocharc.js b/packages/google-cloud-video-transcoder/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-video-transcoder/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-video-transcoder/.nycrc b/packages/google-cloud-video-transcoder/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.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-transcoder/.prettierignore b/packages/google-cloud-video-transcoder/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-video-transcoder/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-video-transcoder/.prettierrc.js b/packages/google-cloud-video-transcoder/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-video-transcoder/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-video-transcoder/.repo-metadata.json b/packages/google-cloud-video-transcoder/.repo-metadata.json new file mode 100644 index 00000000000..4706a93d968 --- /dev/null +++ b/packages/google-cloud-video-transcoder/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/video-transcoder/latest", + "product_documentation": "https://googleapis.dev/nodejs/transcoder/latest", + "name": "transcoder", + "requires_billing": true, + "release_level": "stable", + "language": "nodejs", + "api_id": "transcoder.googleapis.com", + "distribution_name": "@google-cloud/video-transcoder", + "repo": "googleapis/nodejs-video-transcoder", + "codeowner_team": "@googleapis/cloud-media-team", + "issue_tracker": "https://github.com/googleapis/nodejs-video-transcoder/issues", + "name_pretty": "Transcoder API", + "default_version": "v1", + "api_shortname": "transcoder", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-video-transcoder/CHANGELOG.md b/packages/google-cloud-video-transcoder/CHANGELOG.md new file mode 100644 index 00000000000..3848bd3fc50 --- /dev/null +++ b/packages/google-cloud-video-transcoder/CHANGELOG.md @@ -0,0 +1,220 @@ +# Changelog + +## [2.2.3](https://github.com/googleapis/nodejs-video-transcoder/compare/v2.2.2...v2.2.3) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#218](https://github.com/googleapis/nodejs-video-transcoder/issues/218)) ([57badeb](https://github.com/googleapis/nodejs-video-transcoder/commit/57badebacaabed136b8cf2a1a3c77552a5ef249c)) +* Regenerated protos JS and TS definitions ([#222](https://github.com/googleapis/nodejs-video-transcoder/issues/222)) ([4ee236a](https://github.com/googleapis/nodejs-video-transcoder/commit/4ee236a3a7026daeead3eec97fc8c58f32aad86b)) + +## [2.2.2](https://github.com/googleapis/nodejs-video-transcoder/compare/v2.2.1...v2.2.2) (2022-09-23) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#210](https://github.com/googleapis/nodejs-video-transcoder/issues/210)) ([cd73192](https://github.com/googleapis/nodejs-video-transcoder/commit/cd73192a866208be399035e21b1d51e2a1ae1cfc)) + +## [2.2.1](https://github.com/googleapis/nodejs-video-transcoder/compare/v2.2.0...v2.2.1) (2022-09-01) + + +### Bug Fixes + +* better support for fallback mode ([#192](https://github.com/googleapis/nodejs-video-transcoder/issues/192)) ([d46c012](https://github.com/googleapis/nodejs-video-transcoder/commit/d46c0120ebb51275b72e4c4538d1031003c10c3d)) +* change import long to require ([#193](https://github.com/googleapis/nodejs-video-transcoder/issues/193)) ([a620922](https://github.com/googleapis/nodejs-video-transcoder/commit/a62092293b4085ec1affca0f0dd8f698622a981b)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-video-transcoder/issues/1553)) ([#204](https://github.com/googleapis/nodejs-video-transcoder/issues/204)) ([a7bfbd2](https://github.com/googleapis/nodejs-video-transcoder/commit/a7bfbd2a2ee31f8456430adc9f90e365ddcdc98d)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-video-transcoder/issues/1546)) ([#195](https://github.com/googleapis/nodejs-video-transcoder/issues/195)) ([8f21081](https://github.com/googleapis/nodejs-video-transcoder/commit/8f21081c14741ec736b0c418f34a1bd6be329d67)) +* use _gaxModule when accessing gax for bundling ([#205](https://github.com/googleapis/nodejs-video-transcoder/issues/205)) ([836e0f2](https://github.com/googleapis/nodejs-video-transcoder/commit/836e0f2f92ff74d4f5c3a3317ab23ffcdf1ad985)) +* use google-gax v3.3.0 ([a7bfbd2](https://github.com/googleapis/nodejs-video-transcoder/commit/a7bfbd2a2ee31f8456430adc9f90e365ddcdc98d)) + +## [2.2.0](https://github.com/googleapis/nodejs-video-transcoder/compare/v2.1.0...v2.2.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#187](https://github.com/googleapis/nodejs-video-transcoder/issues/187)) ([7924434](https://github.com/googleapis/nodejs-video-transcoder/commit/79244348cb6075c157edf3146c511e2214aa3d90)) + +## [2.1.0](https://github.com/googleapis/nodejs-video-transcoder/compare/v2.0.1...v2.1.0) (2022-06-16) + + +### Features + +* add support for user labels for job and job template ([#184](https://github.com/googleapis/nodejs-video-transcoder/issues/184)) ([675fbd6](https://github.com/googleapis/nodejs-video-transcoder/commit/675fbd6c6f8719f1487c2ef9e19057b71b2e0945)) + +## [2.0.1](https://github.com/googleapis/nodejs-video-transcoder/compare/v2.0.0...v2.0.1) (2022-06-07) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/video-transcoder to v2 ([#177](https://github.com/googleapis/nodejs-video-transcoder/issues/177)) ([ffee92b](https://github.com/googleapis/nodejs-video-transcoder/commit/ffee92b8085a139e279d9f8633f8be51be748f62)) + +## [2.0.0](https://github.com/googleapis/nodejs-video-transcoder/compare/v1.10.0...v2.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#175) + +### Build System + +* update library to use Node 12 ([#175](https://github.com/googleapis/nodejs-video-transcoder/issues/175)) ([555aad4](https://github.com/googleapis/nodejs-video-transcoder/commit/555aad476236704167b667adf79f597baec0b6a1)) + +## [1.10.0](https://github.com/googleapis/nodejs-video-transcoder/compare/v1.9.0...v1.10.0) (2022-02-08) + + +### Features + +* **samples:** delete old test jobs ([#148](https://github.com/googleapis/nodejs-video-transcoder/issues/148)) ([ad94ca0](https://github.com/googleapis/nodejs-video-transcoder/commit/ad94ca047d33e5e99b7c2c626b826e1b8d95ba34)) + + +### Bug Fixes + +* Remove deprecated v1beta1 API that is no longer available ([#154](https://github.com/googleapis/nodejs-video-transcoder/issues/154)) ([76d9aab](https://github.com/googleapis/nodejs-video-transcoder/commit/76d9aabc9d55f636dfcbb6a6dc6d5bf17302d18d)) + +## [1.9.0](https://github.com/googleapis/nodejs-video-transcoder/compare/v1.8.1...v1.9.0) (2022-02-04) + + +### Features + +* **samples:** add samples and tests for adding captions to videos ([#143](https://github.com/googleapis/nodejs-video-transcoder/issues/143)) ([52ca4ff](https://github.com/googleapis/nodejs-video-transcoder/commit/52ca4ff401a21af3c825c1bbe6dc03947bd4c0e0)) + +### [1.8.1](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.8.0...v1.8.1) (2021-12-02) + + +### Bug Fixes + +* add backoff for test retries and get job state queries ([#131](https://www.github.com/googleapis/nodejs-video-transcoder/issues/131)) ([63bba1e](https://www.github.com/googleapis/nodejs-video-transcoder/commit/63bba1ede86c96b3dc1ba2a7616c249525188d9f)) + +## [1.8.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.7.2...v1.8.0) (2021-11-11) + + +### Features + +* **samples:** add example tags to generated samples ([#128](https://www.github.com/googleapis/nodejs-video-transcoder/issues/128)) ([0f2f1a8](https://www.github.com/googleapis/nodejs-video-transcoder/commit/0f2f1a857c154a944521ea230c4295b379450e7f)) + +### [1.7.2](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.7.1...v1.7.2) (2021-10-13) + + +### Bug Fixes + +* remove Encryption settings that were published due to a sync issue BREAKING CHANGE: requests specifying Encryption settings are rejected by the server ([1509f5c](https://www.github.com/googleapis/nodejs-video-transcoder/commit/1509f5ce94912bb64fc48103bbc21fe79d81b277)) +* update nodejs package name to video-transcoder ([#119](https://www.github.com/googleapis/nodejs-video-transcoder/issues/119)) ([1509f5c](https://www.github.com/googleapis/nodejs-video-transcoder/commit/1509f5ce94912bb64fc48103bbc21fe79d81b277)) + +### [1.7.1](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.7.0...v1.7.1) (2021-09-09) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#109](https://www.github.com/googleapis/nodejs-video-transcoder/issues/109)) ([5612895](https://www.github.com/googleapis/nodejs-video-transcoder/commit/5612895e1e4a0cfaaf5722b52da20fba249890c6)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.6.1...v1.7.0) (2021-08-27) + + +### Features + +* turns on self-signed JWT feature flag ([#103](https://www.github.com/googleapis/nodejs-video-transcoder/issues/103)) ([1fba447](https://www.github.com/googleapis/nodejs-video-transcoder/commit/1fba447cd05e0e921198dd0fa9248271f4c48ca3)) + +### [1.6.1](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.6.0...v1.6.1) (2021-08-19) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#100](https://www.github.com/googleapis/nodejs-video-transcoder/issues/100)) ([ae57011](https://www.github.com/googleapis/nodejs-video-transcoder/commit/ae570110ed04943908190c85d91e5204abf8e1b3)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.5.0...v1.6.0) (2021-08-10) + + +### Features + +* Add ttl_after_completion_days field to Job ([75ea7d8](https://www.github.com/googleapis/nodejs-video-transcoder/commit/75ea7d8358da15d795556b7d9bb6777bb7ae4b04)) +* Add video cropping feature ([75ea7d8](https://www.github.com/googleapis/nodejs-video-transcoder/commit/75ea7d8358da15d795556b7d9bb6777bb7ae4b04)) +* Add video padding feature ([75ea7d8](https://www.github.com/googleapis/nodejs-video-transcoder/commit/75ea7d8358da15d795556b7d9bb6777bb7ae4b04)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.4.4...v1.5.0) (2021-07-16) + + +### Features + +* Enables generation of client libraries for C#, php and ruby. ([#82](https://www.github.com/googleapis/nodejs-video-transcoder/issues/82)) ([721a9f9](https://www.github.com/googleapis/nodejs-video-transcoder/commit/721a9f92f1ca280077c728129550977638b6ef3f)) +* Initial commit for the Transcoder V1 client libraries ([#86](https://www.github.com/googleapis/nodejs-video-transcoder/issues/86)) ([578abcb](https://www.github.com/googleapis/nodejs-video-transcoder/commit/578abcb2fd5957f4845e5078af9c881120220288)) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#87](https://www.github.com/googleapis/nodejs-video-transcoder/issues/87)) ([00b82af](https://www.github.com/googleapis/nodejs-video-transcoder/commit/00b82af26623a90c65dd3618e070693ec5df5db5)) + +### [1.4.4](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.4.3...v1.4.4) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#83](https://www.github.com/googleapis/nodejs-video-transcoder/issues/83)) ([d7b29c0](https://www.github.com/googleapis/nodejs-video-transcoder/commit/d7b29c06fcb2a408cf102fa9b1e639c193c70c57)) + +### [1.4.3](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.4.2...v1.4.3) (2021-07-01) + + +### Bug Fixes + +* **deps:** require google-gax v2.17.0 ([#78](https://www.github.com/googleapis/nodejs-video-transcoder/issues/78)) ([cd436f8](https://www.github.com/googleapis/nodejs-video-transcoder/commit/cd436f8198abab33cd9c4fe63d9b64582764ed03)) +* make request optional in all cases ([#74](https://www.github.com/googleapis/nodejs-video-transcoder/issues/74)) ([630b974](https://www.github.com/googleapis/nodejs-video-transcoder/commit/630b974d0e79b805754d2d4f0afc4b7c5ae47f6d)) + +### [1.4.2](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.4.1...v1.4.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#67](https://www.github.com/googleapis/nodejs-video-transcoder/issues/67)) ([6475120](https://www.github.com/googleapis/nodejs-video-transcoder/commit/6475120814774a482655eb3b60e31a7fc00c2504)) + +### [1.4.1](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.4.0...v1.4.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#58](https://www.github.com/googleapis/nodejs-video-transcoder/issues/58)) ([50f8132](https://www.github.com/googleapis/nodejs-video-transcoder/commit/50f813209878f5c2472bd1b38640341ae5715d33)) +* use require() to load JSON protos ([#61](https://www.github.com/googleapis/nodejs-video-transcoder/issues/61)) ([8f4fab7](https://www.github.com/googleapis/nodejs-video-transcoder/commit/8f4fab7b0b796dc730915ff0f06d0e965f0af915)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.3.0...v1.4.0) (2021-03-31) + + +### Features + +* add spritesheet samples and tests. Remove unneeded list jobs ca… ([#43](https://www.github.com/googleapis/nodejs-video-transcoder/issues/43)) ([7508d64](https://www.github.com/googleapis/nodejs-video-transcoder/commit/7508d646c099ef278a402b5a7ad76c3ce926e25f)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.2.0...v1.3.0) (2021-03-15) + + +### Features + +* **samples:** add code samples and tests for overlay creation ([#39](https://www.github.com/googleapis/nodejs-video-transcoder/issues/39)) ([47686fa](https://www.github.com/googleapis/nodejs-video-transcoder/commit/47686fa17c5e5164f6d5f5f37f09d37bd9844cc3)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.1.0...v1.2.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#22](https://www.github.com/googleapis/nodejs-video-transcoder/issues/22)) ([9b9ca5d](https://www.github.com/googleapis/nodejs-video-transcoder/commit/9b9ca5db8168d70b8afb7dc994659ed92d6a645a)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.0.1...v1.1.0) (2020-11-30) + + +### Features + +* **samples:** add Transcoder samples ([#8](https://www.github.com/googleapis/nodejs-video-transcoder/issues/8)) ([7bf59c3](https://www.github.com/googleapis/nodejs-video-transcoder/commit/7bf59c3c9defa1675d07083578b3d3acc9f3fca8)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-video-transcoder/compare/v1.0.0...v1.0.1) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#6](https://www.github.com/googleapis/nodejs-video-transcoder/issues/6)) ([256e65b](https://www.github.com/googleapis/nodejs-video-transcoder/commit/256e65b78b11257ffd499f8cac1d01701419162d)) + +## 1.0.0 (2020-10-29) + + +### ⚠ BREAKING CHANGES + +* initial release of @google-cloud/video-transcoder (#1) + +### Features + +* initial release of @google-cloud/video-transcoder ([#1](https://www.github.com/googleapis/nodejs-video-transcoder/issues/1)) ([2d70e9d](https://www.github.com/googleapis/nodejs-video-transcoder/commit/2d70e9d68f2feb41c59f55f6e736d2a9d07eee9e)) diff --git a/packages/google-cloud-video-transcoder/CODE_OF_CONDUCT.md b/packages/google-cloud-video-transcoder/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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-transcoder/CONTRIBUTING.md b/packages/google-cloud-video-transcoder/CONTRIBUTING.md new file mode 100644 index 00000000000..9f2dd0bbaa9 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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 Transcoder 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=transcoder.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-video-transcoder/LICENSE b/packages/google-cloud-video-transcoder/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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-transcoder/README.md b/packages/google-cloud-video-transcoder/README.md new file mode 100644 index 00000000000..944b5f1790e --- /dev/null +++ b/packages/google-cloud-video-transcoder/README.md @@ -0,0 +1,177 @@ +[//]: # "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 + +# [Transcoder API: Node.js Client](https://github.com/googleapis/nodejs-video-transcoder) + +[![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/video-transcoder.svg)](https://www.npmjs.org/package/@google-cloud/video-transcoder) + + + + +Transcoder client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-video-transcoder/blob/main/CHANGELOG.md). + +* [Transcoder API Node.js Client API Reference][client-docs] +* [Transcoder API Documentation][product-docs] +* [github.com/googleapis/nodejs-video-transcoder](https://github.com/googleapis/nodejs-video-transcoder) + +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 Transcoder 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/video-transcoder +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +// const projectId = 'my-project'; +// const location = 'us-central1'; +const {TranscoderServiceClient} = + require('@google-cloud/video-transcoder').v1; +const client = new TranscoderServiceClient(); +async function listJobs() { + const [jobs] = await client.listJobs({ + parent: client.locationPath(projectId, location), + }); + console.info('jobs:'); + for (const job of jobs) { + console.info(job); + } +} +listJobs(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-video-transcoder/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Create Job From Ad Hoc | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobFromAdHoc.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobFromAdHoc.js,samples/README.md) | +| Create Job From Preset | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobFromPreset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobFromPreset.js,samples/README.md) | +| Create Job From Template | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobFromTemplate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobFromTemplate.js,samples/README.md) | +| Create Job Template | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobTemplate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobTemplate.js,samples/README.md) | +| Create Job With Animated Overlay | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithAnimatedOverlay.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithAnimatedOverlay.js,samples/README.md) | +| Create Job With Concatenated Inputs | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithConcatenatedInputs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithConcatenatedInputs.js,samples/README.md) | +| Create Job With Embedded Captions | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithEmbeddedCaptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithEmbeddedCaptions.js,samples/README.md) | +| Create Job With Periodic Images Spritesheet | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithPeriodicImagesSpritesheet.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithPeriodicImagesSpritesheet.js,samples/README.md) | +| Create Job With Set Number Images Spritesheet | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithSetNumberImagesSpritesheet.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithSetNumberImagesSpritesheet.js,samples/README.md) | +| Create Job With Standalone Captions | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithStandaloneCaptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithStandaloneCaptions.js,samples/README.md) | +| Create Job With Static Overlay | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithStaticOverlay.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithStaticOverlay.js,samples/README.md) | +| Delete Job | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/deleteJob.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/deleteJob.js,samples/README.md) | +| Delete Job Template | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/deleteJobTemplate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/deleteJobTemplate.js,samples/README.md) | +| Get Job | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/getJob.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/getJob.js,samples/README.md) | +| Get Job State | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/getJobState.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/getJobState.js,samples/README.md) | +| Get Job Template | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/getJobTemplate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/getJobTemplate.js,samples/README.md) | +| List Job Templates | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/listJobTemplates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/listJobTemplates.js,samples/README.md) | +| List Jobs | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/listJobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/listJobs.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Transcoder 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/video-transcoder@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-video-transcoder/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-video-transcoder/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/video-transcoder/latest +[product-docs]: https://googleapis.dev/nodejs/transcoder/latest +[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=transcoder.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-video-transcoder/linkinator.config.json b/packages/google-cloud-video-transcoder/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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-transcoder/owlbot.py b/packages/google-cloud-video-transcoder/owlbot.py new file mode 100644 index 00000000000..194f9157882 --- /dev/null +++ b/packages/google-cloud-video-transcoder/owlbot.py @@ -0,0 +1,20 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool.languages.node as node + +node.owlbot_main( + staging_excludes=["package.json", "README.md"], + templates_excludes=[".github/CODEOWNERS"]) diff --git a/packages/google-cloud-video-transcoder/package.json b/packages/google-cloud-video-transcoder/package.json new file mode 100644 index 00000000000..4ffb553a91b --- /dev/null +++ b/packages/google-cloud-video-transcoder/package.json @@ -0,0 +1,65 @@ +{ + "name": "@google-cloud/video-transcoder", + "version": "2.2.3", + "description": "Transcoder client for Node.js", + "repository": "googleapis/nodejs-video-transcoder", + "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 transcoder", + "transcoder", + "transcoder 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 i", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "@google-cloud/video-transcoder": "^2.0.0", + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.0", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-video-transcoder/protos/google/cloud/video/transcoder/v1/resources.proto b/packages/google-cloud-video-transcoder/protos/google/cloud/video/transcoder/v1/resources.proto new file mode 100644 index 00000000000..ce3824ba4ff --- /dev/null +++ b/packages/google-cloud-video-transcoder/protos/google/cloud/video/transcoder/v1/resources.proto @@ -0,0 +1,1095 @@ +// 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.transcoder.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1;transcoder"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.video.transcoder.v1"; + +// Transcoding job resource. +message Job { + option (google.api.resource) = { + type: "transcoder.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/jobs/{job}" + }; + + // The current state of the job. + enum ProcessingState { + // The processing state is not specified. + PROCESSING_STATE_UNSPECIFIED = 0; + + // The job is enqueued and will be picked up for processing soon. + PENDING = 1; + + // The job is being processed. + RUNNING = 2; + + // The job has been completed successfully. + SUCCEEDED = 3; + + // The job has failed. For additional information, see `failure_reason` and + // `failure_details` + FAILED = 4; + } + + // The resource name of the job. + // Format: `projects/{project_number}/locations/{location}/jobs/{job}` + string name = 1; + + // Input only. Specify the `input_uri` to populate empty `uri` fields in each element of + // `Job.config.inputs` or `JobTemplate.config.inputs` when using template. + // URI of the media. Input files must be at least 5 seconds in duration and + // stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). See + // [Supported input and output + // formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). + string input_uri = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or + // `JobTemplate.config.output.uri` when using template. + // URI for the output file(s). For example, `gs://my-bucket/outputs/`. See + // [Supported input and output + // formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). + string output_uri = 3 [(google.api.field_behavior) = INPUT_ONLY]; + + // Specify the `job_config` for the transcoding job. If you don't specify the + // `job_config`, the API selects `templateId`; this template ID is set to + // `preset/web-hd` by default. When you use a `template_id` to create a job, + // the `Job.config` is populated by the `JobTemplate.config`.
+ oneof job_config { + // Input only. Specify the `template_id` to use for populating `Job.config`. The default + // is `preset/web-hd`. + // + // Preset Transcoder templates: + // - `preset/{preset_id}` + // + // - User defined JobTemplate: + // `{job_template_id}` + string template_id = 4 [(google.api.field_behavior) = INPUT_ONLY]; + + // The configuration for this job. + JobConfig config = 5; + } + + // Output only. The current state of the job. + ProcessingState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the job was created. + google.protobuf.Timestamp create_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the transcoding started. + google.protobuf.Timestamp start_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the transcoding finished. + google.protobuf.Timestamp end_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Job time to live value in days, which will be effective after job + // completion. Job should be deleted automatically after the given TTL. Enter + // a value between 1 and 90. The default is 30. + int32 ttl_after_completion_days = 15; + + // The labels associated with this job. You can use these to organize and + // group your jobs. + map labels = 16; + + // 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 = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Transcoding job template resource. +message JobTemplate { + option (google.api.resource) = { + type: "transcoder.googleapis.com/JobTemplate" + pattern: "projects/{project}/locations/{location}/jobTemplates/{job_template}" + }; + + // The resource name of the job template. + // Format: + // `projects/{project_number}/locations/{location}/jobTemplates/{job_template}` + string name = 1; + + // The configuration for this template. + JobConfig config = 2; + + // The labels associated with this job template. You can use these to organize + // and group your job templates. + map labels = 3; +} + +// Job configuration +message JobConfig { + // List of input assets stored in Cloud Storage. + repeated Input inputs = 1; + + // List of `Edit atom`s. Defines the ultimate timeline of the resulting + // file or manifest. + repeated EditAtom edit_list = 2; + + // List of elementary streams. + repeated ElementaryStream elementary_streams = 3; + + // List of multiplexing settings for output streams. + repeated MuxStream mux_streams = 4; + + // List of output manifests. + repeated Manifest manifests = 5; + + // Output configuration. + Output output = 6; + + // List of ad breaks. Specifies where to insert ad break tags in the output + // manifests. + repeated AdBreak ad_breaks = 7; + + // Destination on Pub/Sub. + PubsubDestination pubsub_destination = 8; + + // List of output sprite sheets. + // Spritesheets require at least one VideoStream in the Jobconfig. + repeated SpriteSheet sprite_sheets = 9; + + // List of overlays on the output video, in descending Z-order. + repeated Overlay overlays = 10; +} + +// Input asset. +message Input { + // A unique key for this input. Must be specified when using advanced + // mapping and edit lists. + string key = 1; + + // URI of the media. Input files must be at least 5 seconds in duration and + // stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). + // If empty, the value is populated from `Job.input_uri`. See + // [Supported input and output + // formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). + string uri = 2; + + // Preprocessing configurations. + PreprocessingConfig preprocessing_config = 3; +} + +// Location of output file(s) in a Cloud Storage bucket. +message Output { + // URI for the output file(s). For example, `gs://my-bucket/outputs/`. + // If empty, the value is populated from `Job.output_uri`. See + // [Supported input and output + // formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). + string uri = 1; +} + +// Edit atom. +message EditAtom { + // A unique key for this atom. Must be specified when using advanced + // mapping. + string key = 1; + + // List of `Input.key`s identifying files that should be used in this atom. + // The listed `inputs` must have the same timeline. + repeated string inputs = 2; + + // End time in seconds for the atom, relative to the input file timeline. + // When `end_time_offset` is not specified, the `inputs` are used until + // the end of the atom. + google.protobuf.Duration end_time_offset = 3; + + // Start time in seconds for the atom, relative to the input file timeline. + // The default is `0s`. + google.protobuf.Duration start_time_offset = 4; +} + +// Ad break. +message AdBreak { + // Start time in seconds for the ad break, relative to the output file + // timeline. The default is `0s`. + google.protobuf.Duration start_time_offset = 1; +} + +// Encoding of an input file 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; + + // 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. HLS media manifests will be + // named `MuxStream.key` with the `.m3u8` extension suffix. + string key = 1; + + // The name of the generated file. The default is `MuxStream.key` with the + // extension suffix corresponding to the `MuxStream.container`. + // + // Individual segments also have an incremental 10-digit zero-padded suffix + // starting from 0 before the extension, such as `mux_stream0000000123.ts`. + string file_name = 2; + + // The container format. The default is `mp4` + // + // Supported container formats: + // + // - `ts` + // - `fmp4`- the corresponding file extension is `.m4s` + // - `mp4` + // - `vtt` + // + // See also: + // [Supported input and output + // formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats) + string container = 3; + + // List of `ElementaryStream.key`s multiplexed in this stream. + repeated string elementary_streams = 4; + + // Segment settings for `ts`, `fmp4` and `vtt`. + 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 `HLS` manifest. The corresponding file extension is `.m3u8`. + HLS = 1; + + // Create `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`. + 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 user given `MuxStream.key`s that should appear in this manifest. + // + // When `Manifest.type` is `HLS`, a media manifest with name `MuxStream.key` + // and `.m3u8` extension is generated for each element of the + // `Manifest.mux_streams`. + repeated string mux_streams = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A Pub/Sub destination. +message PubsubDestination { + // The name of the Pub/Sub topic to publish job completion notification + // to. For example: `projects/{project}/topics/{topic}`. + string topic = 1; +} + +// 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. + // + // 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 sprite in pixels. Must be an even integer. To preserve the + // source aspect ratio, set the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels] field or + // the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels] field, but not both (the API will + // automatically calculate the missing field). + int32 sprite_width_pixels = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The height of sprite in pixels. Must be an even integer. To preserve the + // source aspect ratio, set the [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels] field or + // the [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels] field, but not both (the API will + // automatically calculate the missing field). + int32 sprite_height_pixels = 4 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of sprites per row in a sprite sheet. The default is 0, + // which indicates no maximum limit. + int32 column_count = 5; + + // The maximum number of rows per sprite sheet. When the sprite sheet is full, + // a new sprite sheet is created. The default is 0, which indicates no maximum + // limit. + int32 row_count = 6; + + // Start time in seconds, relative to the output file timeline. Determines the + // first sprite to pick. The default is `0s`. + google.protobuf.Duration start_time_offset = 7; + + // End time in seconds, relative to the output file timeline. When + // `end_time_offset` is not specified, the sprites are generated until the end + // of the output file. + google.protobuf.Duration end_time_offset = 8; + + // Specify either total number of sprites or interval to create sprites. + oneof extraction_strategy { + // Total number of sprites. Create the specified number of sprites + // distributed evenly across the timeline of the output media. The default + // is 100. + int32 total_count = 9; + + // Starting from `0s`, create sprites at regular intervals. Specify the + // interval value in seconds. + google.protobuf.Duration interval = 10; + } + + // 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 = 11; +} + +// Overlay configuration. +message Overlay { + // 2D normalized coordinates. Default: `{0.0, 0.0}` + message NormalizedCoordinate { + // Normalized x coordinate. + double x = 1; + + // Normalized y coordinate. + double y = 2; + } + + // Overlaid jpeg image. + message Image { + // Required. URI of the JPEG image in Cloud Storage. For example, + // `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Normalized image resolution, based on output video resolution. Valid + // values: `0.0`–`1.0`. To respect the original image aspect ratio, set + // either `x` or `y` to `0.0`. To use the original image resolution, set + // both `x` and `y` to `0.0`. + NormalizedCoordinate resolution = 2; + + // Target image opacity. Valid values are from `1.0` (solid, default) to + // `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. + double alpha = 3; + } + + // Display static overlay object. + message AnimationStatic { + // Normalized coordinates based on output video resolution. Valid + // values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay + // object. For example, use the x and y coordinates {0,0} to position the + // top-left corner of the overlay animation in the top-left corner of the + // output video. + NormalizedCoordinate xy = 1; + + // The time to start displaying the overlay object, in seconds. Default: 0 + google.protobuf.Duration start_time_offset = 2; + } + + // Fade type for the overlay: `FADE_IN` or `FADE_OUT`. + enum FadeType { + // The fade type is not specified. + FADE_TYPE_UNSPECIFIED = 0; + + // Fade the overlay object into view. + FADE_IN = 1; + + // Fade the overlay object out of view. + FADE_OUT = 2; + } + + // Display overlay object with fade animation. + message AnimationFade { + // Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. + FadeType fade_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Normalized coordinates based on output video resolution. Valid + // values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay + // object. For example, use the x and y coordinates {0,0} to position the + // top-left corner of the overlay animation in the top-left corner of the + // output video. + NormalizedCoordinate xy = 2; + + // The time to start the fade animation, in seconds. Default: 0 + google.protobuf.Duration start_time_offset = 3; + + // The time to end the fade animation, in seconds. Default: + // `start_time_offset` + 1s + google.protobuf.Duration end_time_offset = 4; + } + + // End previous overlay animation from the video. Without AnimationEnd, the + // overlay object will keep the state of previous animation until the end of + // the video. + message AnimationEnd { + // The time to end overlay object, in seconds. Default: 0 + google.protobuf.Duration start_time_offset = 1; + } + + // Animation types. + message Animation { + // Animations can be static or fade, or they can end the previous animation. + oneof animation_type { + // Display static overlay object. + AnimationStatic animation_static = 1; + + // Display overlay object with fade animation. + AnimationFade animation_fade = 2; + + // End previous animation. + AnimationEnd animation_end = 3; + } + } + + // Image overlay. + Image image = 1; + + // List of Animations. The list should be chronological, without any time + // overlap. + repeated Animation animations = 2; +} + +// Preprocessing configurations. +message PreprocessingConfig { + // Color preprocessing configuration. + // + // **Note:** This configuration is not supported. + message Color { + // Control color saturation of the video. Enter a value between -1 and 1, + // where -1 is fully desaturated and 1 is maximum saturation. 0 is no + // change. The default is 0. + double saturation = 1; + + // Control black and white contrast of the video. Enter a value between -1 + // and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no + // change. The default is 0. + double contrast = 2; + + // Control brightness of the video. Enter a value between -1 and 1, where -1 + // is minimum brightness and 1 is maximum brightness. 0 is no change. The + // default is 0. + double brightness = 3; + } + + // Denoise preprocessing configuration. + // + // **Note:** This configuration is not supported. + message Denoise { + // Set strength of the denoise. Enter a value between 0 and 1. The higher + // the value, the smoother the image. 0 is no denoising. The default is 0. + double strength = 1; + + // Set the denoiser mode. The default is `standard`. + // + // Supported denoiser modes: + // + // - `standard` + // - `grain` + string tune = 2; + } + + // Deblock preprocessing configuration. + // + // **Note:** This configuration is not supported. + message Deblock { + // Set strength of the deblocker. Enter a value between 0 and 1. The higher + // the value, the stronger the block removal. 0 is no deblocking. The + // default is 0. + double strength = 1; + + // Enable deblocker. The default is `false`. + bool enabled = 2; + } + + // Audio preprocessing configuration. + message Audio { + // Specify audio loudness normalization in loudness units relative to full + // scale (LUFS). Enter a value between -24 and 0 (the default), where: + // + // * -24 is the Advanced Television Systems Committee (ATSC A/85) standard + // * -23 is the EU R128 broadcast standard + // * -19 is the prior standard for online mono audio + // * -18 is the ReplayGain standard + // * -16 is the prior standard for stereo audio + // * -14 is the new online audio standard recommended by Spotify, as well + // as Amazon Echo + // * 0 disables normalization + double lufs = 1; + + // Enable boosting high frequency components. The default is `false`. + // + // **Note:** This field is not supported. + bool high_boost = 2; + + // Enable boosting low frequency components. The default is `false`. + // + // **Note:** This field is not supported. + bool low_boost = 3; + } + + // 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; + } + + // Color preprocessing configuration. + Color color = 1; + + // Denoise preprocessing configuration. + Denoise denoise = 2; + + // Deblock preprocessing configuration. + Deblock deblock = 3; + + // Audio preprocessing configuration. + Audio audio = 4; + + // Specify the video cropping configuration. + Crop crop = 5; + + // Specify the video pad filter configuration. + Pad pad = 6; +} + +// Video stream resource. +message VideoStream { + // H264 codec settings. + message H264CodecSettings { + // The width of the video in pixels. Must be an even integer. + // When not specified, the width is adjusted to match the specified height + // and input aspect ratio. If both are omitted, the input width is used. + int32 width_pixels = 1; + + // The height of the video in pixels. Must be an even integer. + // When not specified, the height is adjusted to match the specified width + // and input aspect ratio. If both are omitted, the input height is used. + int32 height_pixels = 2; + + // Required. The target video frame rate in frames per second (FPS). Must be less than + // or equal to 120. 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. The minimum value is 1,000. + // The maximum value is 800,000,000. + int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED]; + + // Pixel format to use. The default is `yuv420p`. + // + // Supported pixel formats: + // + // - `yuv420p` pixel format + // - `yuv422p` pixel format + // - `yuv444p` pixel format + // - `yuv420p10` 10-bit HDR pixel format + // - `yuv422p10` 10-bit HDR pixel format + // - `yuv444p10` 10-bit HDR pixel format + // - `yuv420p12` 12-bit HDR pixel format + // - `yuv422p12` 12-bit HDR pixel format + // - `yuv444p12` 12-bit HDR pixel format + string pixel_format = 5; + + // Specify the `rate_control_mode`. The default is `vbr`. + // + // Supported rate control modes: + // + // - `vbr` - variable bitrate + // - `crf` - constant rate factor + string rate_control_mode = 6; + + // Target CRF level. Must be between 10 and 36, where 10 is the highest + // quality and 36 is the most efficient compression. The default is 21. + int32 crf_level = 7; + + // Specifies whether an open Group of Pictures (GOP) structure should be + // allowed or not. The default is `false`. + bool allow_open_gop = 8; + + // GOP mode can be either by frame count or duration. + oneof gop_mode { + // Select the GOP size based on the specified frame count. Must be greater + // than zero. + int32 gop_frame_count = 9; + + // Select the GOP size based on the specified duration. The default is + // `3s`. Note that `gopDuration` must be less than or equal to + // [`segmentDuration`](#SegmentSettings), and + // [`segmentDuration`](#SegmentSettings) must be divisible by + // `gopDuration`. + google.protobuf.Duration gop_duration = 10; + } + + // Use two-pass encoding strategy to achieve better video quality. + // `VideoStream.rate_control_mode` must be `vbr`. The default is `false`. + bool enable_two_pass = 11; + + // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be + // greater than zero. The default is equal to `VideoStream.bitrate_bps`. + int32 vbv_size_bits = 12; + + // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. + // Must be greater than zero. The default is equal to 90% of + // `VideoStream.vbv_size_bits`. + int32 vbv_fullness_bits = 13; + + // The entropy coder to use. The default is `cabac`. + // + // Supported entropy coders: + // + // - `cavlc` + // - `cabac` + string entropy_coder = 14; + + // Allow B-pyramid for reference frame selection. This may not be supported + // on all decoders. The default is `false`. + bool b_pyramid = 15; + + // The number of consecutive B-frames. Must be greater than or equal to + // zero. Must be less than `VideoStream.gop_frame_count` if set. The default + // is 0. + int32 b_frame_count = 16; + + // 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 = 17; + + // Enforces the specified codec profile. The following profiles are + // supported: + // + // * `baseline` + // * `main` + // * `high` (default) + // + // The available options are + // [FFmpeg-compatible](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` + // message. + string profile = 18; + + // Enforces the specified codec tune. The available options are + // [FFmpeg-compatible](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` + // message. + string tune = 19; + + // Enforces the specified codec preset. The default is `veryfast`. The + // available options are + // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the `H264CodecSettings` + // message. + string preset = 20; + } + + // H265 codec settings. + message H265CodecSettings { + // The width of the video in pixels. Must be an even integer. + // When not specified, the width is adjusted to match the specified height + // and input aspect ratio. If both are omitted, the input width is used. + int32 width_pixels = 1; + + // The height of the video in pixels. Must be an even integer. + // When not specified, the height is adjusted to match the specified width + // and input aspect ratio. If both are omitted, the input height is used. + int32 height_pixels = 2; + + // Required. The target video frame rate in frames per second (FPS). Must be less than + // or equal to 120. 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. The minimum value is 1,000. + // The maximum value is 800,000,000. + int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED]; + + // Pixel format to use. The default is `yuv420p`. + // + // Supported pixel formats: + // + // - `yuv420p` pixel format + // - `yuv422p` pixel format + // - `yuv444p` pixel format + // - `yuv420p10` 10-bit HDR pixel format + // - `yuv422p10` 10-bit HDR pixel format + // - `yuv444p10` 10-bit HDR pixel format + // - `yuv420p12` 12-bit HDR pixel format + // - `yuv422p12` 12-bit HDR pixel format + // - `yuv444p12` 12-bit HDR pixel format + string pixel_format = 5; + + // Specify the `rate_control_mode`. The default is `vbr`. + // + // Supported rate control modes: + // + // - `vbr` - variable bitrate + // - `crf` - constant rate factor + string rate_control_mode = 6; + + // Target CRF level. Must be between 10 and 36, where 10 is the highest + // quality and 36 is the most efficient compression. The default is 21. + int32 crf_level = 7; + + // Specifies whether an open Group of Pictures (GOP) structure should be + // allowed or not. The default is `false`. + bool allow_open_gop = 8; + + // GOP mode can be either by frame count or duration. + oneof gop_mode { + // Select the GOP size based on the specified frame count. Must be greater + // than zero. + int32 gop_frame_count = 9; + + // Select the GOP size based on the specified duration. The default is + // `3s`. Note that `gopDuration` must be less than or equal to + // [`segmentDuration`](#SegmentSettings), and + // [`segmentDuration`](#SegmentSettings) must be divisible by + // `gopDuration`. + google.protobuf.Duration gop_duration = 10; + } + + // Use two-pass encoding strategy to achieve better video quality. + // `VideoStream.rate_control_mode` must be `vbr`. The default is `false`. + bool enable_two_pass = 11; + + // Size of the Video Buffering Verifier (VBV) buffer in bits. Must be + // greater than zero. The default is equal to `VideoStream.bitrate_bps`. + int32 vbv_size_bits = 12; + + // Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. + // Must be greater than zero. The default is equal to 90% of + // `VideoStream.vbv_size_bits`. + int32 vbv_fullness_bits = 13; + + // Allow B-pyramid for reference frame selection. This may not be supported + // on all decoders. The default is `false`. + bool b_pyramid = 14; + + // The number of consecutive B-frames. Must be greater than or equal to + // zero. Must be less than `VideoStream.gop_frame_count` if set. The default + // is 0. + int32 b_frame_count = 15; + + // 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 = 16; + + // Enforces the specified codec profile. The following profiles are + // supported: + // + // * 8-bit profiles + // * `main` (default) + // * `main-intra` + // * `mainstillpicture` + // * 10-bit profiles + // * `main10` (default) + // * `main10-intra` + // * `main422-10` + // * `main422-10-intra` + // * `main444-10` + // * `main444-10-intra` + // * 12-bit profiles + // * `main12` (default) + // * `main12-intra` + // * `main422-12` + // * `main422-12-intra` + // * `main444-12` + // * `main444-12-intra` + // + // The available options are + // [FFmpeg-compatible](https://x265.readthedocs.io/). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the `H265CodecSettings` + // message. + string profile = 17; + + // Enforces the specified codec tune. The available options are + // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the `H265CodecSettings` + // message. + string tune = 18; + + // Enforces the specified codec preset. The default is `veryfast`. The + // available options are + // [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the `H265CodecSettings` + // message. + string preset = 19; + } + + // VP9 codec settings. + message Vp9CodecSettings { + // The width of the video in pixels. Must be an even integer. + // When not specified, the width is adjusted to match the specified height + // and input aspect ratio. If both are omitted, the input width is used. + int32 width_pixels = 1; + + // The height of the video in pixels. Must be an even integer. + // When not specified, the height is adjusted to match the specified width + // and input aspect ratio. If both are omitted, the input height is used. + int32 height_pixels = 2; + + // Required. The target video frame rate in frames per second (FPS). Must be less than + // or equal to 120. 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. The minimum value is 1,000. + // The maximum value is 480,000,000. + int32 bitrate_bps = 4 [(google.api.field_behavior) = REQUIRED]; + + // Pixel format to use. The default is `yuv420p`. + // + // Supported pixel formats: + // + // - `yuv420p` pixel format + // - `yuv422p` pixel format + // - `yuv444p` pixel format + // - `yuv420p10` 10-bit HDR pixel format + // - `yuv422p10` 10-bit HDR pixel format + // - `yuv444p10` 10-bit HDR pixel format + // - `yuv420p12` 12-bit HDR pixel format + // - `yuv422p12` 12-bit HDR pixel format + // - `yuv444p12` 12-bit HDR pixel format + string pixel_format = 5; + + // Specify the `rate_control_mode`. The default is `vbr`. + // + // Supported rate control modes: + // + // - `vbr` - variable bitrate + string rate_control_mode = 6; + + // Target CRF level. Must be between 10 and 36, where 10 is the highest + // quality and 36 is the most efficient compression. The default is 21. + // + // **Note:** This field is not supported. + int32 crf_level = 7; + + // GOP mode can be either by frame count or duration. + oneof gop_mode { + // Select the GOP size based on the specified frame count. Must be greater + // than zero. + int32 gop_frame_count = 8; + + // Select the GOP size based on the specified duration. The default is + // `3s`. Note that `gopDuration` must be less than or equal to + // [`segmentDuration`](#SegmentSettings), and + // [`segmentDuration`](#SegmentSettings) must be divisible by + // `gopDuration`. + google.protobuf.Duration gop_duration = 9; + } + + // Enforces the specified codec profile. The following profiles are + // supported: + // + // * `profile0` (default) + // * `profile1` + // * `profile2` + // * `profile3` + // + // The available options are + // [WebM-compatible](https://www.webmproject.org/vp9/profiles/). + // Note that certain values for this field may cause the + // transcoder to override other fields you set in the `Vp9CodecSettings` + // message. + string profile = 10; + } + + // Codec settings can be h264, h265, or vp9. + oneof codec_settings { + // H264 codec settings. + H264CodecSettings h264 = 1; + + // H265 codec settings. + H265CodecSettings h265 = 2; + + // VP9 codec settings. + Vp9CodecSettings vp9 = 3; + } +} + +// Audio stream resource. +message AudioStream { + // The mapping for the `Job.edit_list` atoms with audio `EditAtom.inputs`. + message AudioMapping { + // Required. The `EditAtom.key` that references the atom with audio inputs in the + // `Job.edit_list`. + string atom_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Input.key` that identifies the input file. + string input_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the track in the input file. + int32 input_track = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the channel in the input audio stream. + int32 input_channel = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the channel in the output audio stream. + int32 output_channel = 5 [(google.api.field_behavior) = REQUIRED]; + + // Audio volume control in dB. Negative values decrease volume, + // positive values increase. The default is 0. + double gain_db = 6; + } + + // The codec for this audio stream. The default is `aac`. + // + // Supported audio codecs: + // + // - `aac` + // - `aac-he` + // - `aac-he-v2` + // - `mp3` + // - `ac3` + // - `eac3` + 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 `Job.edit_list` atoms with audio `EditAtom.inputs`. + 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 { + // The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. + message TextMapping { + // Required. The `EditAtom.key` that references atom with text inputs in the + // `Job.edit_list`. + string atom_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Input.key` that identifies the input file. + string input_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zero-based index of the track in the input file. + int32 input_track = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The codec for this text stream. The default is `webvtt`. + // + // Supported text codecs: + // + // - `srt` + // - `ttml` + // - `cea608` + // - `cea708` + // - `webvtt` + string codec = 1; + + // The mapping for the `Job.edit_list` atoms with text `EditAtom.inputs`. + repeated TextMapping mapping = 3; +} + +// Segment settings for `ts`, `fmp4` and `vtt`. +message SegmentSettings { + // Duration of the segments in seconds. The default is `6.0s`. Note that + // `segmentDuration` must be greater than or equal to + // [`gopDuration`](#videostream), and `segmentDuration` must be divisible by + // [`gopDuration`](#videostream). + google.protobuf.Duration segment_duration = 1; + + // Required. Create an individual segment file. The default is `false`. + bool individual_segments = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-video-transcoder/protos/google/cloud/video/transcoder/v1/services.proto b/packages/google-cloud-video-transcoder/protos/google/cloud/video/transcoder/v1/services.proto new file mode 100644 index 00000000000..4d400c33b7a --- /dev/null +++ b/packages/google-cloud-video-transcoder/protos/google/cloud/video/transcoder/v1/services.proto @@ -0,0 +1,281 @@ +// 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.transcoder.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/transcoder/v1/resources.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.Video.Transcoder.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1;transcoder"; +option java_multiple_files = true; +option java_outer_classname = "ServicesProto"; +option java_package = "com.google.cloud.video.transcoder.v1"; +option php_namespace = "Google\\Cloud\\Video\\Transcoder\\V1"; +option ruby_package = "Google::Cloud::Video::Transcoder::V1"; + +// Using the Transcoder API, you can queue asynchronous jobs for transcoding +// media into various output formats. Output formats may include different +// streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive +// Streaming over HTTP (DASH). You can also customize jobs using advanced +// features such as Digital Rights Management (DRM), audio equalization, content +// concatenation, and digital ad-stitch ready content generation. +service TranscoderService { + option (google.api.default_host) = "transcoder.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a job in the specified region. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + option (google.api.method_signature) = "parent,job"; + } + + // Lists jobs in the specified region. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/jobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the job data. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a job. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a job template in the specified region. + rpc CreateJobTemplate(CreateJobTemplateRequest) returns (JobTemplate) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/jobTemplates" + body: "job_template" + }; + option (google.api.method_signature) = "parent,job_template,job_template_id"; + } + + // Lists job templates in the specified region. + rpc ListJobTemplates(ListJobTemplatesRequest) returns (ListJobTemplatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/jobTemplates" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns the job template data. + rpc GetJobTemplate(GetJobTemplateRequest) returns (JobTemplate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/jobTemplates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a job template. + rpc DeleteJobTemplate(DeleteJobTemplateRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/jobTemplates/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for `TranscoderService.CreateJob`. +message CreateJobRequest { + // Required. The parent location to create and process this job. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Parameters for creating transcoding job. + Job job = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for `TranscoderService.ListJobs`. +// The parent location from which to retrieve the collection of jobs. +message ListJobsRequest { + // Required. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The `next_page_token` value returned from a previous List request, if + // any. + string page_token = 3; + + // The filter expression, following the syntax outlined in + // https://google.aip.dev/160. + string filter = 4; + + // One or more fields to compare and use to sort the output. + // See https://google.aip.dev/132#ordering. + string order_by = 5; +} + +// Request message for `TranscoderService.GetJob`. +message GetJobRequest { + // Required. The name of the job to retrieve. + // Format: `projects/{project}/locations/{location}/jobs/{job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "transcoder.googleapis.com/Job" + } + ]; +} + +// Request message for `TranscoderService.DeleteJob`. +message DeleteJobRequest { + // Required. The name of the job to delete. + // Format: `projects/{project}/locations/{location}/jobs/{job}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "transcoder.googleapis.com/Job" + } + ]; + + // If set to true, and the job is not found, the request will succeed but no + // action will be taken on the server. + bool allow_missing = 2; +} + +// Response message for `TranscoderService.ListJobs`. +message ListJobsResponse { + // List of jobs in the specified region. + repeated Job jobs = 1; + + // The pagination token. + string next_page_token = 2; + + // List of regions that could not be reached. + repeated string unreachable = 3; +} + +// Request message for `TranscoderService.CreateJobTemplate`. +message CreateJobTemplateRequest { + // Required. The parent location to create this job template. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Parameters for creating job template. + JobTemplate job_template = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the job template, which will become the final component + // of the job template's resource name. + // + // This value should be 4-63 characters, and valid characters must match the + // regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. + string job_template_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for `TranscoderService.ListJobTemplates`. +message ListJobTemplatesRequest { + // Required. The parent location from which to retrieve the collection of job templates. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The `next_page_token` value returned from a previous List request, if + // any. + string page_token = 3; + + // The filter expression, following the syntax outlined in + // https://google.aip.dev/160. + string filter = 4; + + // One or more fields to compare and use to sort the output. + // See https://google.aip.dev/132#ordering. + string order_by = 5; +} + +// Request message for `TranscoderService.GetJobTemplate`. +message GetJobTemplateRequest { + // Required. The name of the job template to retrieve. + // Format: + // `projects/{project}/locations/{location}/jobTemplates/{job_template}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "transcoder.googleapis.com/JobTemplate" + } + ]; +} + +// Request message for `TranscoderService.DeleteJobTemplate`. +message DeleteJobTemplateRequest { + // Required. The name of the job template to delete. + // `projects/{project}/locations/{location}/jobTemplates/{job_template}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "transcoder.googleapis.com/JobTemplate" + } + ]; + + // If set to true, and the job template is not found, the request will succeed + // but no action will be taken on the server. + bool allow_missing = 2; +} + +// Response message for `TranscoderService.ListJobTemplates`. +message ListJobTemplatesResponse { + // List of job templates in the specified region. + repeated JobTemplate job_templates = 1; + + // The pagination token. + string next_page_token = 2; + + // List of regions that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-video-transcoder/protos/protos.d.ts b/packages/google-cloud-video-transcoder/protos/protos.d.ts new file mode 100644 index 00000000000..c6899704b8b --- /dev/null +++ b/packages/google-cloud-video-transcoder/protos/protos.d.ts @@ -0,0 +1,10060 @@ +// 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 transcoder. */ + namespace transcoder { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job inputUri */ + inputUri?: (string|null); + + /** Job outputUri */ + outputUri?: (string|null); + + /** Job templateId */ + templateId?: (string|null); + + /** Job config */ + config?: (google.cloud.video.transcoder.v1.IJobConfig|null); + + /** Job state */ + state?: (google.cloud.video.transcoder.v1.Job.ProcessingState|keyof typeof google.cloud.video.transcoder.v1.Job.ProcessingState|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Job endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Job ttlAfterCompletionDays */ + ttlAfterCompletionDays?: (number|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IJob); + + /** Job name. */ + public name: string; + + /** Job inputUri. */ + public inputUri: string; + + /** Job outputUri. */ + public outputUri: string; + + /** Job templateId. */ + public templateId?: (string|null); + + /** Job config. */ + public config?: (google.cloud.video.transcoder.v1.IJobConfig|null); + + /** Job state. */ + public state: (google.cloud.video.transcoder.v1.Job.ProcessingState|keyof typeof google.cloud.video.transcoder.v1.Job.ProcessingState); + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Job endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Job ttlAfterCompletionDays. */ + public ttlAfterCompletionDays: number; + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job error. */ + public error?: (google.rpc.IStatus|null); + + /** Job jobConfig. */ + public jobConfig?: ("templateId"|"config"); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IJob): google.cloud.video.transcoder.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.video.transcoder.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.video.transcoder.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.video.transcoder.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** ProcessingState enum. */ + enum ProcessingState { + PROCESSING_STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4 + } + } + + /** Properties of a JobTemplate. */ + interface IJobTemplate { + + /** JobTemplate name */ + name?: (string|null); + + /** JobTemplate config */ + config?: (google.cloud.video.transcoder.v1.IJobConfig|null); + + /** JobTemplate labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a JobTemplate. */ + class JobTemplate implements IJobTemplate { + + /** + * Constructs a new JobTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IJobTemplate); + + /** JobTemplate name. */ + public name: string; + + /** JobTemplate config. */ + public config?: (google.cloud.video.transcoder.v1.IJobConfig|null); + + /** JobTemplate labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new JobTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns JobTemplate instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IJobTemplate): google.cloud.video.transcoder.v1.JobTemplate; + + /** + * Encodes the specified JobTemplate message. Does not implicitly {@link google.cloud.video.transcoder.v1.JobTemplate.verify|verify} messages. + * @param message JobTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IJobTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobTemplate message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.JobTemplate.verify|verify} messages. + * @param message JobTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IJobTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobTemplate + * @throws {Error} If the payload is not 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.transcoder.v1.JobTemplate; + + /** + * Decodes a JobTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobTemplate + * @throws {Error} If the payload 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.transcoder.v1.JobTemplate; + + /** + * Verifies a JobTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.JobTemplate; + + /** + * Creates a plain object from a JobTemplate message. Also converts values to other types if specified. + * @param message JobTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.JobTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobConfig. */ + interface IJobConfig { + + /** JobConfig inputs */ + inputs?: (google.cloud.video.transcoder.v1.IInput[]|null); + + /** JobConfig editList */ + editList?: (google.cloud.video.transcoder.v1.IEditAtom[]|null); + + /** JobConfig elementaryStreams */ + elementaryStreams?: (google.cloud.video.transcoder.v1.IElementaryStream[]|null); + + /** JobConfig muxStreams */ + muxStreams?: (google.cloud.video.transcoder.v1.IMuxStream[]|null); + + /** JobConfig manifests */ + manifests?: (google.cloud.video.transcoder.v1.IManifest[]|null); + + /** JobConfig output */ + output?: (google.cloud.video.transcoder.v1.IOutput|null); + + /** JobConfig adBreaks */ + adBreaks?: (google.cloud.video.transcoder.v1.IAdBreak[]|null); + + /** JobConfig pubsubDestination */ + pubsubDestination?: (google.cloud.video.transcoder.v1.IPubsubDestination|null); + + /** JobConfig spriteSheets */ + spriteSheets?: (google.cloud.video.transcoder.v1.ISpriteSheet[]|null); + + /** JobConfig overlays */ + overlays?: (google.cloud.video.transcoder.v1.IOverlay[]|null); + } + + /** Represents a JobConfig. */ + class JobConfig implements IJobConfig { + + /** + * Constructs a new JobConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IJobConfig); + + /** JobConfig inputs. */ + public inputs: google.cloud.video.transcoder.v1.IInput[]; + + /** JobConfig editList. */ + public editList: google.cloud.video.transcoder.v1.IEditAtom[]; + + /** JobConfig elementaryStreams. */ + public elementaryStreams: google.cloud.video.transcoder.v1.IElementaryStream[]; + + /** JobConfig muxStreams. */ + public muxStreams: google.cloud.video.transcoder.v1.IMuxStream[]; + + /** JobConfig manifests. */ + public manifests: google.cloud.video.transcoder.v1.IManifest[]; + + /** JobConfig output. */ + public output?: (google.cloud.video.transcoder.v1.IOutput|null); + + /** JobConfig adBreaks. */ + public adBreaks: google.cloud.video.transcoder.v1.IAdBreak[]; + + /** JobConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.video.transcoder.v1.IPubsubDestination|null); + + /** JobConfig spriteSheets. */ + public spriteSheets: google.cloud.video.transcoder.v1.ISpriteSheet[]; + + /** JobConfig overlays. */ + public overlays: google.cloud.video.transcoder.v1.IOverlay[]; + + /** + * Creates a new JobConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns JobConfig instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IJobConfig): google.cloud.video.transcoder.v1.JobConfig; + + /** + * Encodes the specified JobConfig message. Does not implicitly {@link google.cloud.video.transcoder.v1.JobConfig.verify|verify} messages. + * @param message JobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobConfig message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.JobConfig.verify|verify} messages. + * @param message JobConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IJobConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobConfig + * @throws {Error} If the payload is not 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.transcoder.v1.JobConfig; + + /** + * Decodes a JobConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobConfig + * @throws {Error} If the payload 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.transcoder.v1.JobConfig; + + /** + * Verifies a JobConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.JobConfig; + + /** + * Creates a plain object from a JobConfig message. Also converts values to other types if specified. + * @param message JobConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.JobConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobConfig + * @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 key */ + key?: (string|null); + + /** Input uri */ + uri?: (string|null); + + /** Input preprocessingConfig */ + preprocessingConfig?: (google.cloud.video.transcoder.v1.IPreprocessingConfig|null); + } + + /** Represents an Input. */ + class Input implements IInput { + + /** + * Constructs a new Input. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IInput); + + /** Input key. */ + public key: string; + + /** Input uri. */ + public uri: string; + + /** Input preprocessingConfig. */ + public preprocessingConfig?: (google.cloud.video.transcoder.v1.IPreprocessingConfig|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.transcoder.v1.IInput): google.cloud.video.transcoder.v1.Input; + + /** + * Encodes the specified Input message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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; + } + + /** 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.transcoder.v1.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.transcoder.v1.IOutput): google.cloud.video.transcoder.v1.Output; + + /** + * Encodes the specified Output message. Does not implicitly {@link google.cloud.video.transcoder.v1.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.transcoder.v1.IOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Output message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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; + } + + /** Properties of an EditAtom. */ + interface IEditAtom { + + /** EditAtom key */ + key?: (string|null); + + /** EditAtom inputs */ + inputs?: (string[]|null); + + /** EditAtom endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + + /** EditAtom startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an EditAtom. */ + class EditAtom implements IEditAtom { + + /** + * Constructs a new EditAtom. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IEditAtom); + + /** EditAtom key. */ + public key: string; + + /** EditAtom inputs. */ + public inputs: string[]; + + /** EditAtom endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** EditAtom startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new EditAtom instance using the specified properties. + * @param [properties] Properties to set + * @returns EditAtom instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IEditAtom): google.cloud.video.transcoder.v1.EditAtom; + + /** + * Encodes the specified EditAtom message. Does not implicitly {@link google.cloud.video.transcoder.v1.EditAtom.verify|verify} messages. + * @param message EditAtom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IEditAtom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditAtom message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.EditAtom.verify|verify} messages. + * @param message EditAtom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IEditAtom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditAtom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditAtom + * @throws {Error} If the payload is not 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.transcoder.v1.EditAtom; + + /** + * Decodes an EditAtom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditAtom + * @throws {Error} If the payload 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.transcoder.v1.EditAtom; + + /** + * Verifies an EditAtom message. + * @param message Plain 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 EditAtom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditAtom + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.EditAtom; + + /** + * Creates a plain object from an EditAtom message. Also converts values to other types if specified. + * @param message EditAtom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.EditAtom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditAtom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditAtom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdBreak. */ + interface IAdBreak { + + /** AdBreak startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an AdBreak. */ + class AdBreak implements IAdBreak { + + /** + * Constructs a new AdBreak. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IAdBreak); + + /** AdBreak startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new AdBreak instance using the specified properties. + * @param [properties] Properties to set + * @returns AdBreak instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IAdBreak): google.cloud.video.transcoder.v1.AdBreak; + + /** + * Encodes the specified AdBreak message. Does not implicitly {@link google.cloud.video.transcoder.v1.AdBreak.verify|verify} messages. + * @param message AdBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IAdBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdBreak message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.AdBreak.verify|verify} messages. + * @param message AdBreak message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IAdBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdBreak message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdBreak + * @throws {Error} If the payload is not 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.transcoder.v1.AdBreak; + + /** + * Decodes an AdBreak message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdBreak + * @throws {Error} If the payload 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.transcoder.v1.AdBreak; + + /** + * Verifies an AdBreak message. + * @param message Plain 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 AdBreak message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdBreak + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.AdBreak; + + /** + * Creates a plain object from an AdBreak message. Also converts values to other types if specified. + * @param message AdBreak + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.AdBreak, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdBreak to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdBreak + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ElementaryStream. */ + interface IElementaryStream { + + /** ElementaryStream key */ + key?: (string|null); + + /** ElementaryStream videoStream */ + videoStream?: (google.cloud.video.transcoder.v1.IVideoStream|null); + + /** ElementaryStream audioStream */ + audioStream?: (google.cloud.video.transcoder.v1.IAudioStream|null); + + /** ElementaryStream textStream */ + textStream?: (google.cloud.video.transcoder.v1.ITextStream|null); + } + + /** Represents an ElementaryStream. */ + class ElementaryStream implements IElementaryStream { + + /** + * Constructs a new ElementaryStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IElementaryStream); + + /** ElementaryStream key. */ + public key: string; + + /** ElementaryStream videoStream. */ + public videoStream?: (google.cloud.video.transcoder.v1.IVideoStream|null); + + /** ElementaryStream audioStream. */ + public audioStream?: (google.cloud.video.transcoder.v1.IAudioStream|null); + + /** ElementaryStream textStream. */ + public textStream?: (google.cloud.video.transcoder.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.transcoder.v1.IElementaryStream): google.cloud.video.transcoder.v1.ElementaryStream; + + /** + * Encodes the specified ElementaryStream message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IElementaryStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ElementaryStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 fileName */ + fileName?: (string|null); + + /** MuxStream container */ + container?: (string|null); + + /** MuxStream elementaryStreams */ + elementaryStreams?: (string[]|null); + + /** MuxStream segmentSettings */ + segmentSettings?: (google.cloud.video.transcoder.v1.ISegmentSettings|null); + } + + /** Represents a MuxStream. */ + class MuxStream implements IMuxStream { + + /** + * Constructs a new MuxStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IMuxStream); + + /** MuxStream key. */ + public key: string; + + /** MuxStream fileName. */ + public fileName: string; + + /** MuxStream container. */ + public container: string; + + /** MuxStream elementaryStreams. */ + public elementaryStreams: string[]; + + /** MuxStream segmentSettings. */ + public segmentSettings?: (google.cloud.video.transcoder.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.transcoder.v1.IMuxStream): google.cloud.video.transcoder.v1.MuxStream; + + /** + * Encodes the specified MuxStream message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IMuxStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MuxStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.Manifest.ManifestType|keyof typeof google.cloud.video.transcoder.v1.Manifest.ManifestType|null); + + /** Manifest muxStreams */ + muxStreams?: (string[]|null); + } + + /** Represents a Manifest. */ + class Manifest implements IManifest { + + /** + * Constructs a new Manifest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IManifest); + + /** Manifest fileName. */ + public fileName: string; + + /** Manifest type. */ + public type: (google.cloud.video.transcoder.v1.Manifest.ManifestType|keyof typeof google.cloud.video.transcoder.v1.Manifest.ManifestType); + + /** Manifest muxStreams. */ + public muxStreams: string[]; + + /** + * Creates a new Manifest instance using the specified properties. + * @param [properties] Properties to set + * @returns Manifest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IManifest): google.cloud.video.transcoder.v1.Manifest; + + /** + * Encodes the specified Manifest message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Manifest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IPubsubDestination): google.cloud.video.transcoder.v1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.video.transcoder.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubDestination + * @throws {Error} If the payload is not 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.transcoder.v1.PubsubDestination; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubDestination + * @throws {Error} If the payload 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.transcoder.v1.PubsubDestination; + + /** + * Verifies a PubsubDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.PubsubDestination; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** SpriteSheet endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + + /** SpriteSheet totalCount */ + totalCount?: (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.transcoder.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 startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** SpriteSheet endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** SpriteSheet totalCount. */ + public totalCount?: (number|null); + + /** SpriteSheet interval. */ + public interval?: (google.protobuf.IDuration|null); + + /** SpriteSheet quality. */ + public quality: number; + + /** SpriteSheet extractionStrategy. */ + public extractionStrategy?: ("totalCount"|"interval"); + + /** + * Creates a new SpriteSheet instance using the specified properties. + * @param [properties] Properties to set + * @returns SpriteSheet instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.ISpriteSheet): google.cloud.video.transcoder.v1.SpriteSheet; + + /** + * Encodes the specified SpriteSheet message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.ISpriteSheet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpriteSheet message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 an Overlay. */ + interface IOverlay { + + /** Overlay image */ + image?: (google.cloud.video.transcoder.v1.Overlay.IImage|null); + + /** Overlay animations */ + animations?: (google.cloud.video.transcoder.v1.Overlay.IAnimation[]|null); + } + + /** Represents an Overlay. */ + class Overlay implements IOverlay { + + /** + * Constructs a new Overlay. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IOverlay); + + /** Overlay image. */ + public image?: (google.cloud.video.transcoder.v1.Overlay.IImage|null); + + /** Overlay animations. */ + public animations: google.cloud.video.transcoder.v1.Overlay.IAnimation[]; + + /** + * Creates a new Overlay instance using the specified properties. + * @param [properties] Properties to set + * @returns Overlay instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IOverlay): google.cloud.video.transcoder.v1.Overlay; + + /** + * Encodes the specified Overlay message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.verify|verify} messages. + * @param message Overlay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IOverlay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Overlay message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.verify|verify} messages. + * @param message Overlay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IOverlay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Overlay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Overlay + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay; + + /** + * Decodes an Overlay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Overlay + * @throws {Error} If the payload 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.transcoder.v1.Overlay; + + /** + * Verifies an Overlay message. + * @param message Plain 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 Overlay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Overlay + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay; + + /** + * Creates a plain object from an Overlay message. Also converts values to other types if specified. + * @param message Overlay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Overlay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Overlay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Overlay { + + /** Properties of a NormalizedCoordinate. */ + interface INormalizedCoordinate { + + /** NormalizedCoordinate x */ + x?: (number|null); + + /** NormalizedCoordinate y */ + y?: (number|null); + } + + /** Represents a NormalizedCoordinate. */ + class NormalizedCoordinate implements INormalizedCoordinate { + + /** + * Constructs a new NormalizedCoordinate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate); + + /** NormalizedCoordinate x. */ + public x: number; + + /** NormalizedCoordinate y. */ + public y: number; + + /** + * Creates a new NormalizedCoordinate instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedCoordinate instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate): google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate; + + /** + * Encodes the specified NormalizedCoordinate message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify|verify} messages. + * @param message NormalizedCoordinate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedCoordinate message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify|verify} messages. + * @param message NormalizedCoordinate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedCoordinate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedCoordinate + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay.NormalizedCoordinate; + + /** + * Decodes a NormalizedCoordinate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedCoordinate + * @throws {Error} If the payload 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.transcoder.v1.Overlay.NormalizedCoordinate; + + /** + * Verifies a NormalizedCoordinate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedCoordinate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedCoordinate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate; + + /** + * Creates a plain object from a NormalizedCoordinate message. Also converts values to other types if specified. + * @param message NormalizedCoordinate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedCoordinate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedCoordinate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image uri */ + uri?: (string|null); + + /** Image resolution */ + resolution?: (google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null); + + /** Image alpha */ + alpha?: (number|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.Overlay.IImage); + + /** Image uri. */ + public uri: string; + + /** Image resolution. */ + public resolution?: (google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null); + + /** Image alpha. */ + public alpha: number; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.Overlay.IImage): google.cloud.video.transcoder.v1.Overlay.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.Overlay.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.Overlay.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload 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.transcoder.v1.Overlay.Image; + + /** + * Verifies an Image message. + * @param message Plain 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 Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnimationStatic. */ + interface IAnimationStatic { + + /** AnimationStatic xy */ + xy?: (google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null); + + /** AnimationStatic startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an AnimationStatic. */ + class AnimationStatic implements IAnimationStatic { + + /** + * Constructs a new AnimationStatic. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimationStatic); + + /** AnimationStatic xy. */ + public xy?: (google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null); + + /** AnimationStatic startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new AnimationStatic instance using the specified properties. + * @param [properties] Properties to set + * @returns AnimationStatic instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimationStatic): google.cloud.video.transcoder.v1.Overlay.AnimationStatic; + + /** + * Encodes the specified AnimationStatic message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationStatic.verify|verify} messages. + * @param message AnimationStatic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.Overlay.IAnimationStatic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnimationStatic message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationStatic.verify|verify} messages. + * @param message AnimationStatic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.Overlay.IAnimationStatic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnimationStatic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnimationStatic + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay.AnimationStatic; + + /** + * Decodes an AnimationStatic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnimationStatic + * @throws {Error} If the payload 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.transcoder.v1.Overlay.AnimationStatic; + + /** + * Verifies an AnimationStatic message. + * @param message Plain 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 AnimationStatic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnimationStatic + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay.AnimationStatic; + + /** + * Creates a plain object from an AnimationStatic message. Also converts values to other types if specified. + * @param message AnimationStatic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay.AnimationStatic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnimationStatic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnimationStatic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FadeType enum. */ + enum FadeType { + FADE_TYPE_UNSPECIFIED = 0, + FADE_IN = 1, + FADE_OUT = 2 + } + + /** Properties of an AnimationFade. */ + interface IAnimationFade { + + /** AnimationFade fadeType */ + fadeType?: (google.cloud.video.transcoder.v1.Overlay.FadeType|keyof typeof google.cloud.video.transcoder.v1.Overlay.FadeType|null); + + /** AnimationFade xy */ + xy?: (google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null); + + /** AnimationFade startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** AnimationFade endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an AnimationFade. */ + class AnimationFade implements IAnimationFade { + + /** + * Constructs a new AnimationFade. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimationFade); + + /** AnimationFade fadeType. */ + public fadeType: (google.cloud.video.transcoder.v1.Overlay.FadeType|keyof typeof google.cloud.video.transcoder.v1.Overlay.FadeType); + + /** AnimationFade xy. */ + public xy?: (google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null); + + /** AnimationFade startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** AnimationFade endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new AnimationFade instance using the specified properties. + * @param [properties] Properties to set + * @returns AnimationFade instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimationFade): google.cloud.video.transcoder.v1.Overlay.AnimationFade; + + /** + * Encodes the specified AnimationFade message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationFade.verify|verify} messages. + * @param message AnimationFade message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.Overlay.IAnimationFade, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnimationFade message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationFade.verify|verify} messages. + * @param message AnimationFade message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.Overlay.IAnimationFade, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnimationFade message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnimationFade + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay.AnimationFade; + + /** + * Decodes an AnimationFade message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnimationFade + * @throws {Error} If the payload 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.transcoder.v1.Overlay.AnimationFade; + + /** + * Verifies an AnimationFade message. + * @param message Plain 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 AnimationFade message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnimationFade + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay.AnimationFade; + + /** + * Creates a plain object from an AnimationFade message. Also converts values to other types if specified. + * @param message AnimationFade + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay.AnimationFade, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnimationFade to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnimationFade + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnimationEnd. */ + interface IAnimationEnd { + + /** AnimationEnd startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an AnimationEnd. */ + class AnimationEnd implements IAnimationEnd { + + /** + * Constructs a new AnimationEnd. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimationEnd); + + /** AnimationEnd startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new AnimationEnd instance using the specified properties. + * @param [properties] Properties to set + * @returns AnimationEnd instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimationEnd): google.cloud.video.transcoder.v1.Overlay.AnimationEnd; + + /** + * Encodes the specified AnimationEnd message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationEnd.verify|verify} messages. + * @param message AnimationEnd message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.Overlay.IAnimationEnd, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnimationEnd message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationEnd.verify|verify} messages. + * @param message AnimationEnd message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.Overlay.IAnimationEnd, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnimationEnd message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnimationEnd + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay.AnimationEnd; + + /** + * Decodes an AnimationEnd message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnimationEnd + * @throws {Error} If the payload 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.transcoder.v1.Overlay.AnimationEnd; + + /** + * Verifies an AnimationEnd message. + * @param message Plain 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 AnimationEnd message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnimationEnd + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay.AnimationEnd; + + /** + * Creates a plain object from an AnimationEnd message. Also converts values to other types if specified. + * @param message AnimationEnd + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay.AnimationEnd, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnimationEnd to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnimationEnd + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Animation. */ + interface IAnimation { + + /** Animation animationStatic */ + animationStatic?: (google.cloud.video.transcoder.v1.Overlay.IAnimationStatic|null); + + /** Animation animationFade */ + animationFade?: (google.cloud.video.transcoder.v1.Overlay.IAnimationFade|null); + + /** Animation animationEnd */ + animationEnd?: (google.cloud.video.transcoder.v1.Overlay.IAnimationEnd|null); + } + + /** Represents an Animation. */ + class Animation implements IAnimation { + + /** + * Constructs a new Animation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimation); + + /** Animation animationStatic. */ + public animationStatic?: (google.cloud.video.transcoder.v1.Overlay.IAnimationStatic|null); + + /** Animation animationFade. */ + public animationFade?: (google.cloud.video.transcoder.v1.Overlay.IAnimationFade|null); + + /** Animation animationEnd. */ + public animationEnd?: (google.cloud.video.transcoder.v1.Overlay.IAnimationEnd|null); + + /** Animation animationType. */ + public animationType?: ("animationStatic"|"animationFade"|"animationEnd"); + + /** + * Creates a new Animation instance using the specified properties. + * @param [properties] Properties to set + * @returns Animation instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.Overlay.IAnimation): google.cloud.video.transcoder.v1.Overlay.Animation; + + /** + * Encodes the specified Animation message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Animation.verify|verify} messages. + * @param message Animation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.Overlay.IAnimation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Animation message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Animation.verify|verify} messages. + * @param message Animation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.Overlay.IAnimation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Animation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Animation + * @throws {Error} If the payload is not 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.transcoder.v1.Overlay.Animation; + + /** + * Decodes an Animation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Animation + * @throws {Error} If the payload 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.transcoder.v1.Overlay.Animation; + + /** + * Verifies an Animation message. + * @param message Plain 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 Animation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Animation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.Overlay.Animation; + + /** + * Creates a plain object from an Animation message. Also converts values to other types if specified. + * @param message Animation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.Overlay.Animation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Animation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Animation + * @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 color */ + color?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IColor|null); + + /** PreprocessingConfig denoise */ + denoise?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise|null); + + /** PreprocessingConfig deblock */ + deblock?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock|null); + + /** PreprocessingConfig audio */ + audio?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio|null); + + /** PreprocessingConfig crop */ + crop?: (google.cloud.video.transcoder.v1.PreprocessingConfig.ICrop|null); + + /** PreprocessingConfig pad */ + pad?: (google.cloud.video.transcoder.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.transcoder.v1.IPreprocessingConfig); + + /** PreprocessingConfig color. */ + public color?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IColor|null); + + /** PreprocessingConfig denoise. */ + public denoise?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise|null); + + /** PreprocessingConfig deblock. */ + public deblock?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock|null); + + /** PreprocessingConfig audio. */ + public audio?: (google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio|null); + + /** PreprocessingConfig crop. */ + public crop?: (google.cloud.video.transcoder.v1.PreprocessingConfig.ICrop|null); + + /** PreprocessingConfig pad. */ + public pad?: (google.cloud.video.transcoder.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.transcoder.v1.IPreprocessingConfig): google.cloud.video.transcoder.v1.PreprocessingConfig; + + /** + * Encodes the specified PreprocessingConfig message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IPreprocessingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreprocessingConfig message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 Color. */ + interface IColor { + + /** Color saturation */ + saturation?: (number|null); + + /** Color contrast */ + contrast?: (number|null); + + /** Color brightness */ + brightness?: (number|null); + } + + /** Represents a Color. */ + class Color implements IColor { + + /** + * Constructs a new Color. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IColor); + + /** Color saturation. */ + public saturation: number; + + /** Color contrast. */ + public contrast: number; + + /** Color brightness. */ + public brightness: number; + + /** + * Creates a new Color instance using the specified properties. + * @param [properties] Properties to set + * @returns Color instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IColor): google.cloud.video.transcoder.v1.PreprocessingConfig.Color; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Color.verify|verify} messages. + * @param message Color message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Color message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Color + * @throws {Error} If the payload is not 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.transcoder.v1.PreprocessingConfig.Color; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Color + * @throws {Error} If the payload 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.transcoder.v1.PreprocessingConfig.Color; + + /** + * Verifies a Color message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Color + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.PreprocessingConfig.Color; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @param message Color + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.PreprocessingConfig.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Color to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Color + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Denoise. */ + interface IDenoise { + + /** Denoise strength */ + strength?: (number|null); + + /** Denoise tune */ + tune?: (string|null); + } + + /** Represents a Denoise. */ + class Denoise implements IDenoise { + + /** + * Constructs a new Denoise. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise); + + /** Denoise strength. */ + public strength: number; + + /** Denoise tune. */ + public tune: string; + + /** + * Creates a new Denoise instance using the specified properties. + * @param [properties] Properties to set + * @returns Denoise instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise): google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise; + + /** + * Encodes the specified Denoise message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.verify|verify} messages. + * @param message Denoise message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Denoise message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.verify|verify} messages. + * @param message Denoise message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Denoise message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Denoise + * @throws {Error} If the payload is not 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.transcoder.v1.PreprocessingConfig.Denoise; + + /** + * Decodes a Denoise message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Denoise + * @throws {Error} If the payload 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.transcoder.v1.PreprocessingConfig.Denoise; + + /** + * Verifies a Denoise message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Denoise message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Denoise + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise; + + /** + * Creates a plain object from a Denoise message. Also converts values to other types if specified. + * @param message Denoise + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Denoise to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Denoise + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Deblock. */ + interface IDeblock { + + /** Deblock strength */ + strength?: (number|null); + + /** Deblock enabled */ + enabled?: (boolean|null); + } + + /** Represents a Deblock. */ + class Deblock implements IDeblock { + + /** + * Constructs a new Deblock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock); + + /** Deblock strength. */ + public strength: number; + + /** Deblock enabled. */ + public enabled: boolean; + + /** + * Creates a new Deblock instance using the specified properties. + * @param [properties] Properties to set + * @returns Deblock instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock): google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock; + + /** + * Encodes the specified Deblock message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.verify|verify} messages. + * @param message Deblock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deblock message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.verify|verify} messages. + * @param message Deblock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deblock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deblock + * @throws {Error} If the payload is not 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.transcoder.v1.PreprocessingConfig.Deblock; + + /** + * Decodes a Deblock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deblock + * @throws {Error} If the payload 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.transcoder.v1.PreprocessingConfig.Deblock; + + /** + * Verifies a Deblock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deblock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deblock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock; + + /** + * Creates a plain object from a Deblock message. Also converts values to other types if specified. + * @param message Deblock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deblock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deblock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Audio. */ + interface IAudio { + + /** Audio lufs */ + lufs?: (number|null); + + /** Audio highBoost */ + highBoost?: (boolean|null); + + /** Audio lowBoost */ + lowBoost?: (boolean|null); + } + + /** Represents an Audio. */ + class Audio implements IAudio { + + /** + * Constructs a new Audio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio); + + /** Audio lufs. */ + public lufs: number; + + /** Audio highBoost. */ + public highBoost: boolean; + + /** Audio lowBoost. */ + public lowBoost: boolean; + + /** + * Creates a new Audio instance using the specified properties. + * @param [properties] Properties to set + * @returns Audio instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio): google.cloud.video.transcoder.v1.PreprocessingConfig.Audio; + + /** + * Encodes the specified Audio message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @param message Audio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Audio message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @param message Audio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Audio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Audio + * @throws {Error} If the payload is not 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.transcoder.v1.PreprocessingConfig.Audio; + + /** + * Decodes an Audio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Audio + * @throws {Error} If the payload 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.transcoder.v1.PreprocessingConfig.Audio; + + /** + * Verifies an Audio message. + * @param message Plain 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 Audio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Audio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.PreprocessingConfig.Audio; + + /** + * Creates a plain object from an Audio message. Also converts values to other types if specified. + * @param message Audio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.PreprocessingConfig.Audio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Audio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Audio + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.transcoder.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.transcoder.v1.PreprocessingConfig.ICrop): google.cloud.video.transcoder.v1.PreprocessingConfig.Crop; + + /** + * Encodes the specified Crop message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.ICrop, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Crop message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.IPad): google.cloud.video.transcoder.v1.PreprocessingConfig.Pad; + + /** + * Encodes the specified Pad message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.IPad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Pad message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.VideoStream.IH264CodecSettings|null); + + /** VideoStream h265 */ + h265?: (google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings|null); + + /** VideoStream vp9 */ + vp9?: (google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings|null); + } + + /** Represents a VideoStream. */ + class VideoStream implements IVideoStream { + + /** + * Constructs a new VideoStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IVideoStream); + + /** VideoStream h264. */ + public h264?: (google.cloud.video.transcoder.v1.VideoStream.IH264CodecSettings|null); + + /** VideoStream h265. */ + public h265?: (google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings|null); + + /** VideoStream vp9. */ + public vp9?: (google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings|null); + + /** VideoStream codecSettings. */ + public codecSettings?: ("h264"|"h265"|"vp9"); + + /** + * Creates a new VideoStream instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoStream instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IVideoStream): google.cloud.video.transcoder.v1.VideoStream; + + /** + * Encodes the specified VideoStream message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IVideoStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 pixelFormat */ + pixelFormat?: (string|null); + + /** H264CodecSettings rateControlMode */ + rateControlMode?: (string|null); + + /** H264CodecSettings crfLevel */ + crfLevel?: (number|null); + + /** H264CodecSettings allowOpenGop */ + allowOpenGop?: (boolean|null); + + /** H264CodecSettings gopFrameCount */ + gopFrameCount?: (number|null); + + /** H264CodecSettings gopDuration */ + gopDuration?: (google.protobuf.IDuration|null); + + /** H264CodecSettings enableTwoPass */ + enableTwoPass?: (boolean|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); + + /** H264CodecSettings preset */ + preset?: (string|null); + } + + /** Represents a H264CodecSettings. */ + class H264CodecSettings implements IH264CodecSettings { + + /** + * Constructs a new H264CodecSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.VideoStream.IH264CodecSettings); + + /** H264CodecSettings widthPixels. */ + public widthPixels: number; + + /** H264CodecSettings heightPixels. */ + public heightPixels: number; + + /** H264CodecSettings frameRate. */ + public frameRate: number; + + /** H264CodecSettings bitrateBps. */ + public bitrateBps: number; + + /** H264CodecSettings pixelFormat. */ + public pixelFormat: string; + + /** H264CodecSettings rateControlMode. */ + public rateControlMode: string; + + /** H264CodecSettings crfLevel. */ + public crfLevel: number; + + /** H264CodecSettings allowOpenGop. */ + public allowOpenGop: boolean; + + /** H264CodecSettings gopFrameCount. */ + public gopFrameCount?: (number|null); + + /** H264CodecSettings gopDuration. */ + public gopDuration?: (google.protobuf.IDuration|null); + + /** H264CodecSettings enableTwoPass. */ + public enableTwoPass: boolean; + + /** 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 preset. */ + public preset: 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.transcoder.v1.VideoStream.IH264CodecSettings): google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings; + + /** + * Encodes the specified H264CodecSettings message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.VideoStream.IH264CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified H264CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 a H265CodecSettings. */ + interface IH265CodecSettings { + + /** H265CodecSettings widthPixels */ + widthPixels?: (number|null); + + /** H265CodecSettings heightPixels */ + heightPixels?: (number|null); + + /** H265CodecSettings frameRate */ + frameRate?: (number|null); + + /** H265CodecSettings bitrateBps */ + bitrateBps?: (number|null); + + /** H265CodecSettings pixelFormat */ + pixelFormat?: (string|null); + + /** H265CodecSettings rateControlMode */ + rateControlMode?: (string|null); + + /** H265CodecSettings crfLevel */ + crfLevel?: (number|null); + + /** H265CodecSettings allowOpenGop */ + allowOpenGop?: (boolean|null); + + /** H265CodecSettings gopFrameCount */ + gopFrameCount?: (number|null); + + /** H265CodecSettings gopDuration */ + gopDuration?: (google.protobuf.IDuration|null); + + /** H265CodecSettings enableTwoPass */ + enableTwoPass?: (boolean|null); + + /** H265CodecSettings vbvSizeBits */ + vbvSizeBits?: (number|null); + + /** H265CodecSettings vbvFullnessBits */ + vbvFullnessBits?: (number|null); + + /** H265CodecSettings bPyramid */ + bPyramid?: (boolean|null); + + /** H265CodecSettings bFrameCount */ + bFrameCount?: (number|null); + + /** H265CodecSettings aqStrength */ + aqStrength?: (number|null); + + /** H265CodecSettings profile */ + profile?: (string|null); + + /** H265CodecSettings tune */ + tune?: (string|null); + + /** H265CodecSettings preset */ + preset?: (string|null); + } + + /** Represents a H265CodecSettings. */ + class H265CodecSettings implements IH265CodecSettings { + + /** + * Constructs a new H265CodecSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings); + + /** H265CodecSettings widthPixels. */ + public widthPixels: number; + + /** H265CodecSettings heightPixels. */ + public heightPixels: number; + + /** H265CodecSettings frameRate. */ + public frameRate: number; + + /** H265CodecSettings bitrateBps. */ + public bitrateBps: number; + + /** H265CodecSettings pixelFormat. */ + public pixelFormat: string; + + /** H265CodecSettings rateControlMode. */ + public rateControlMode: string; + + /** H265CodecSettings crfLevel. */ + public crfLevel: number; + + /** H265CodecSettings allowOpenGop. */ + public allowOpenGop: boolean; + + /** H265CodecSettings gopFrameCount. */ + public gopFrameCount?: (number|null); + + /** H265CodecSettings gopDuration. */ + public gopDuration?: (google.protobuf.IDuration|null); + + /** H265CodecSettings enableTwoPass. */ + public enableTwoPass: boolean; + + /** H265CodecSettings vbvSizeBits. */ + public vbvSizeBits: number; + + /** H265CodecSettings vbvFullnessBits. */ + public vbvFullnessBits: number; + + /** H265CodecSettings bPyramid. */ + public bPyramid: boolean; + + /** H265CodecSettings bFrameCount. */ + public bFrameCount: number; + + /** H265CodecSettings aqStrength. */ + public aqStrength: number; + + /** H265CodecSettings profile. */ + public profile: string; + + /** H265CodecSettings tune. */ + public tune: string; + + /** H265CodecSettings preset. */ + public preset: string; + + /** H265CodecSettings gopMode. */ + public gopMode?: ("gopFrameCount"|"gopDuration"); + + /** + * Creates a new H265CodecSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns H265CodecSettings instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings): google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings; + + /** + * Encodes the specified H265CodecSettings message. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.verify|verify} messages. + * @param message H265CodecSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified H265CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.verify|verify} messages. + * @param message H265CodecSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a H265CodecSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns H265CodecSettings + * @throws {Error} If the payload is not 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.transcoder.v1.VideoStream.H265CodecSettings; + + /** + * Decodes a H265CodecSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns H265CodecSettings + * @throws {Error} If the payload 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.transcoder.v1.VideoStream.H265CodecSettings; + + /** + * Verifies a H265CodecSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a H265CodecSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns H265CodecSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings; + + /** + * Creates a plain object from a H265CodecSettings message. Also converts values to other types if specified. + * @param message H265CodecSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this H265CodecSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for H265CodecSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Vp9CodecSettings. */ + interface IVp9CodecSettings { + + /** Vp9CodecSettings widthPixels */ + widthPixels?: (number|null); + + /** Vp9CodecSettings heightPixels */ + heightPixels?: (number|null); + + /** Vp9CodecSettings frameRate */ + frameRate?: (number|null); + + /** Vp9CodecSettings bitrateBps */ + bitrateBps?: (number|null); + + /** Vp9CodecSettings pixelFormat */ + pixelFormat?: (string|null); + + /** Vp9CodecSettings rateControlMode */ + rateControlMode?: (string|null); + + /** Vp9CodecSettings crfLevel */ + crfLevel?: (number|null); + + /** Vp9CodecSettings gopFrameCount */ + gopFrameCount?: (number|null); + + /** Vp9CodecSettings gopDuration */ + gopDuration?: (google.protobuf.IDuration|null); + + /** Vp9CodecSettings profile */ + profile?: (string|null); + } + + /** Represents a Vp9CodecSettings. */ + class Vp9CodecSettings implements IVp9CodecSettings { + + /** + * Constructs a new Vp9CodecSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings); + + /** Vp9CodecSettings widthPixels. */ + public widthPixels: number; + + /** Vp9CodecSettings heightPixels. */ + public heightPixels: number; + + /** Vp9CodecSettings frameRate. */ + public frameRate: number; + + /** Vp9CodecSettings bitrateBps. */ + public bitrateBps: number; + + /** Vp9CodecSettings pixelFormat. */ + public pixelFormat: string; + + /** Vp9CodecSettings rateControlMode. */ + public rateControlMode: string; + + /** Vp9CodecSettings crfLevel. */ + public crfLevel: number; + + /** Vp9CodecSettings gopFrameCount. */ + public gopFrameCount?: (number|null); + + /** Vp9CodecSettings gopDuration. */ + public gopDuration?: (google.protobuf.IDuration|null); + + /** Vp9CodecSettings profile. */ + public profile: string; + + /** Vp9CodecSettings gopMode. */ + public gopMode?: ("gopFrameCount"|"gopDuration"); + + /** + * Creates a new Vp9CodecSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns Vp9CodecSettings instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings): google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings; + + /** + * Encodes the specified Vp9CodecSettings message. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.verify|verify} messages. + * @param message Vp9CodecSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vp9CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.verify|verify} messages. + * @param message Vp9CodecSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vp9CodecSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vp9CodecSettings + * @throws {Error} If the payload is not 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.transcoder.v1.VideoStream.Vp9CodecSettings; + + /** + * Decodes a Vp9CodecSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vp9CodecSettings + * @throws {Error} If the payload 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.transcoder.v1.VideoStream.Vp9CodecSettings; + + /** + * Verifies a Vp9CodecSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vp9CodecSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vp9CodecSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings; + + /** + * Creates a plain object from a Vp9CodecSettings message. Also converts values to other types if specified. + * @param message Vp9CodecSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vp9CodecSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vp9CodecSettings + * @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 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.transcoder.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.transcoder.v1.IAudioStream); + + /** 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.transcoder.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.transcoder.v1.IAudioStream): google.cloud.video.transcoder.v1.AudioStream; + + /** + * Encodes the specified AudioStream message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.IAudioStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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 atomKey */ + atomKey?: (string|null); + + /** AudioMapping inputKey */ + inputKey?: (string|null); + + /** AudioMapping inputTrack */ + inputTrack?: (number|null); + + /** AudioMapping inputChannel */ + inputChannel?: (number|null); + + /** AudioMapping outputChannel */ + outputChannel?: (number|null); + + /** AudioMapping gainDb */ + gainDb?: (number|null); + } + + /** Represents an AudioMapping. */ + class AudioMapping implements IAudioMapping { + + /** + * Constructs a new AudioMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.AudioStream.IAudioMapping); + + /** AudioMapping atomKey. */ + public atomKey: string; + + /** AudioMapping inputKey. */ + public inputKey: string; + + /** AudioMapping inputTrack. */ + public inputTrack: number; + + /** AudioMapping inputChannel. */ + public inputChannel: number; + + /** AudioMapping outputChannel. */ + public outputChannel: number; + + /** AudioMapping gainDb. */ + public gainDb: 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.transcoder.v1.AudioStream.IAudioMapping): google.cloud.video.transcoder.v1.AudioStream.AudioMapping; + + /** + * Encodes the specified AudioMapping message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.AudioStream.IAudioMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioMapping message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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); + + /** TextStream mapping */ + mapping?: (google.cloud.video.transcoder.v1.TextStream.ITextMapping[]|null); + } + + /** Represents a TextStream. */ + class TextStream implements ITextStream { + + /** + * Constructs a new TextStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.ITextStream); + + /** TextStream codec. */ + public codec: string; + + /** TextStream mapping. */ + public mapping: google.cloud.video.transcoder.v1.TextStream.ITextMapping[]; + + /** + * Creates a new TextStream instance using the specified properties. + * @param [properties] Properties to set + * @returns TextStream instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.ITextStream): google.cloud.video.transcoder.v1.TextStream; + + /** + * Encodes the specified TextStream message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.ITextStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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; + } + + namespace TextStream { + + /** Properties of a TextMapping. */ + interface ITextMapping { + + /** TextMapping atomKey */ + atomKey?: (string|null); + + /** TextMapping inputKey */ + inputKey?: (string|null); + + /** TextMapping inputTrack */ + inputTrack?: (number|null); + } + + /** Represents a TextMapping. */ + class TextMapping implements ITextMapping { + + /** + * Constructs a new TextMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.TextStream.ITextMapping); + + /** TextMapping atomKey. */ + public atomKey: string; + + /** TextMapping inputKey. */ + public inputKey: string; + + /** TextMapping inputTrack. */ + public inputTrack: number; + + /** + * Creates a new TextMapping instance using the specified properties. + * @param [properties] Properties to set + * @returns TextMapping instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.TextStream.ITextMapping): google.cloud.video.transcoder.v1.TextStream.TextMapping; + + /** + * Encodes the specified TextMapping message. Does not implicitly {@link google.cloud.video.transcoder.v1.TextStream.TextMapping.verify|verify} messages. + * @param message TextMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.TextStream.ITextMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextMapping message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.TextStream.TextMapping.verify|verify} messages. + * @param message TextMapping message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.TextStream.ITextMapping, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextMapping message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextMapping + * @throws {Error} If the payload is not 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.transcoder.v1.TextStream.TextMapping; + + /** + * Decodes a TextMapping message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextMapping + * @throws {Error} If the payload 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.transcoder.v1.TextStream.TextMapping; + + /** + * Verifies a TextMapping message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextMapping message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextMapping + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.TextStream.TextMapping; + + /** + * Creates a plain object from a TextMapping message. Also converts values to other types if specified. + * @param message TextMapping + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.TextStream.TextMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextMapping to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextMapping + * @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); + + /** SegmentSettings individualSegments */ + individualSegments?: (boolean|null); + } + + /** Represents a SegmentSettings. */ + class SegmentSettings implements ISegmentSettings { + + /** + * Constructs a new SegmentSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.ISegmentSettings); + + /** SegmentSettings segmentDuration. */ + public segmentDuration?: (google.protobuf.IDuration|null); + + /** SegmentSettings individualSegments. */ + public individualSegments: boolean; + + /** + * Creates a new SegmentSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SegmentSettings instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.ISegmentSettings): google.cloud.video.transcoder.v1.SegmentSettings; + + /** + * Encodes the specified SegmentSettings message. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.v1.ISegmentSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SegmentSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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; + } + + /** Represents a TranscoderService */ + class TranscoderService extends $protobuf.rpc.Service { + + /** + * Constructs a new TranscoderService 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 TranscoderService 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): TranscoderService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.video.transcoder.v1.ICreateJobRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.video.transcoder.v1.ICreateJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.video.transcoder.v1.IListJobsRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.video.transcoder.v1.IListJobsRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.video.transcoder.v1.IGetJobRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.video.transcoder.v1.IGetJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJob(request: google.cloud.video.transcoder.v1.IDeleteJobRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.video.transcoder.v1.IDeleteJobRequest): Promise; + + /** + * Calls CreateJobTemplate. + * @param request CreateJobTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobTemplate + */ + public createJobTemplate(request: google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.CreateJobTemplateCallback): void; + + /** + * Calls CreateJobTemplate. + * @param request CreateJobTemplateRequest message or plain object + * @returns Promise + */ + public createJobTemplate(request: google.cloud.video.transcoder.v1.ICreateJobTemplateRequest): Promise; + + /** + * Calls ListJobTemplates. + * @param request ListJobTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobTemplatesResponse + */ + public listJobTemplates(request: google.cloud.video.transcoder.v1.IListJobTemplatesRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.ListJobTemplatesCallback): void; + + /** + * Calls ListJobTemplates. + * @param request ListJobTemplatesRequest message or plain object + * @returns Promise + */ + public listJobTemplates(request: google.cloud.video.transcoder.v1.IListJobTemplatesRequest): Promise; + + /** + * Calls GetJobTemplate. + * @param request GetJobTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobTemplate + */ + public getJobTemplate(request: google.cloud.video.transcoder.v1.IGetJobTemplateRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.GetJobTemplateCallback): void; + + /** + * Calls GetJobTemplate. + * @param request GetJobTemplateRequest message or plain object + * @returns Promise + */ + public getJobTemplate(request: google.cloud.video.transcoder.v1.IGetJobTemplateRequest): Promise; + + /** + * Calls DeleteJobTemplate. + * @param request DeleteJobTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJobTemplate(request: google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, callback: google.cloud.video.transcoder.v1.TranscoderService.DeleteJobTemplateCallback): void; + + /** + * Calls DeleteJobTemplate. + * @param request DeleteJobTemplateRequest message or plain object + * @returns Promise + */ + public deleteJobTemplate(request: google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest): Promise; + } + + namespace TranscoderService { + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.video.transcoder.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.video.transcoder.v1.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.video.transcoder.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|deleteJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|createJobTemplate}. + * @param error Error, if any + * @param [response] JobTemplate + */ + type CreateJobTemplateCallback = (error: (Error|null), response?: google.cloud.video.transcoder.v1.JobTemplate) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|listJobTemplates}. + * @param error Error, if any + * @param [response] ListJobTemplatesResponse + */ + type ListJobTemplatesCallback = (error: (Error|null), response?: google.cloud.video.transcoder.v1.ListJobTemplatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|getJobTemplate}. + * @param error Error, if any + * @param [response] JobTemplate + */ + type GetJobTemplateCallback = (error: (Error|null), response?: google.cloud.video.transcoder.v1.JobTemplate) => void; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|deleteJobTemplate}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.video.transcoder.v1.IJob|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.video.transcoder.v1.IJob|null); + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.ICreateJobRequest): google.cloud.video.transcoder.v1.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not 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.transcoder.v1.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload 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.transcoder.v1.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IListJobsRequest): google.cloud.video.transcoder.v1.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not 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.transcoder.v1.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload 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.transcoder.v1.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IGetJobRequest): google.cloud.video.transcoder.v1.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not 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.transcoder.v1.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload 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.transcoder.v1.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + + /** DeleteJobRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** DeleteJobRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IDeleteJobRequest): google.cloud.video.transcoder.v1.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not 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.transcoder.v1.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload 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.transcoder.v1.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.video.transcoder.v1.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.video.transcoder.v1.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IListJobsResponse): google.cloud.video.transcoder.v1.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not 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.transcoder.v1.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload 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.transcoder.v1.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateJobTemplateRequest. */ + interface ICreateJobTemplateRequest { + + /** CreateJobTemplateRequest parent */ + parent?: (string|null); + + /** CreateJobTemplateRequest jobTemplate */ + jobTemplate?: (google.cloud.video.transcoder.v1.IJobTemplate|null); + + /** CreateJobTemplateRequest jobTemplateId */ + jobTemplateId?: (string|null); + } + + /** Represents a CreateJobTemplateRequest. */ + class CreateJobTemplateRequest implements ICreateJobTemplateRequest { + + /** + * Constructs a new CreateJobTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.ICreateJobTemplateRequest); + + /** CreateJobTemplateRequest parent. */ + public parent: string; + + /** CreateJobTemplateRequest jobTemplate. */ + public jobTemplate?: (google.cloud.video.transcoder.v1.IJobTemplate|null); + + /** CreateJobTemplateRequest jobTemplateId. */ + public jobTemplateId: string; + + /** + * Creates a new CreateJobTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobTemplateRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.ICreateJobTemplateRequest): google.cloud.video.transcoder.v1.CreateJobTemplateRequest; + + /** + * Encodes the specified CreateJobTemplateRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobTemplateRequest.verify|verify} messages. + * @param message CreateJobTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobTemplateRequest.verify|verify} messages. + * @param message CreateJobTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobTemplateRequest + * @throws {Error} If the payload is not 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.transcoder.v1.CreateJobTemplateRequest; + + /** + * Decodes a CreateJobTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobTemplateRequest + * @throws {Error} If the payload 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.transcoder.v1.CreateJobTemplateRequest; + + /** + * Verifies a CreateJobTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.CreateJobTemplateRequest; + + /** + * Creates a plain object from a CreateJobTemplateRequest message. Also converts values to other types if specified. + * @param message CreateJobTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.CreateJobTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobTemplatesRequest. */ + interface IListJobTemplatesRequest { + + /** ListJobTemplatesRequest parent */ + parent?: (string|null); + + /** ListJobTemplatesRequest pageSize */ + pageSize?: (number|null); + + /** ListJobTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListJobTemplatesRequest filter */ + filter?: (string|null); + + /** ListJobTemplatesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListJobTemplatesRequest. */ + class ListJobTemplatesRequest implements IListJobTemplatesRequest { + + /** + * Constructs a new ListJobTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IListJobTemplatesRequest); + + /** ListJobTemplatesRequest parent. */ + public parent: string; + + /** ListJobTemplatesRequest pageSize. */ + public pageSize: number; + + /** ListJobTemplatesRequest pageToken. */ + public pageToken: string; + + /** ListJobTemplatesRequest filter. */ + public filter: string; + + /** ListJobTemplatesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListJobTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobTemplatesRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IListJobTemplatesRequest): google.cloud.video.transcoder.v1.ListJobTemplatesRequest; + + /** + * Encodes the specified ListJobTemplatesRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesRequest.verify|verify} messages. + * @param message ListJobTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IListJobTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesRequest.verify|verify} messages. + * @param message ListJobTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IListJobTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobTemplatesRequest + * @throws {Error} If the payload is not 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.transcoder.v1.ListJobTemplatesRequest; + + /** + * Decodes a ListJobTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobTemplatesRequest + * @throws {Error} If the payload 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.transcoder.v1.ListJobTemplatesRequest; + + /** + * Verifies a ListJobTemplatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.ListJobTemplatesRequest; + + /** + * Creates a plain object from a ListJobTemplatesRequest message. Also converts values to other types if specified. + * @param message ListJobTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.ListJobTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobTemplatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobTemplateRequest. */ + interface IGetJobTemplateRequest { + + /** GetJobTemplateRequest name */ + name?: (string|null); + } + + /** Represents a GetJobTemplateRequest. */ + class GetJobTemplateRequest implements IGetJobTemplateRequest { + + /** + * Constructs a new GetJobTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IGetJobTemplateRequest); + + /** GetJobTemplateRequest name. */ + public name: string; + + /** + * Creates a new GetJobTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobTemplateRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IGetJobTemplateRequest): google.cloud.video.transcoder.v1.GetJobTemplateRequest; + + /** + * Encodes the specified GetJobTemplateRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobTemplateRequest.verify|verify} messages. + * @param message GetJobTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IGetJobTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobTemplateRequest.verify|verify} messages. + * @param message GetJobTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IGetJobTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobTemplateRequest + * @throws {Error} If the payload is not 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.transcoder.v1.GetJobTemplateRequest; + + /** + * Decodes a GetJobTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobTemplateRequest + * @throws {Error} If the payload 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.transcoder.v1.GetJobTemplateRequest; + + /** + * Verifies a GetJobTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.GetJobTemplateRequest; + + /** + * Creates a plain object from a GetJobTemplateRequest message. Also converts values to other types if specified. + * @param message GetJobTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.GetJobTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobTemplateRequest. */ + interface IDeleteJobTemplateRequest { + + /** DeleteJobTemplateRequest name */ + name?: (string|null); + + /** DeleteJobTemplateRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents a DeleteJobTemplateRequest. */ + class DeleteJobTemplateRequest implements IDeleteJobTemplateRequest { + + /** + * Constructs a new DeleteJobTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest); + + /** DeleteJobTemplateRequest name. */ + public name: string; + + /** DeleteJobTemplateRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new DeleteJobTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobTemplateRequest instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest): google.cloud.video.transcoder.v1.DeleteJobTemplateRequest; + + /** + * Encodes the specified DeleteJobTemplateRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobTemplateRequest.verify|verify} messages. + * @param message DeleteJobTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobTemplateRequest.verify|verify} messages. + * @param message DeleteJobTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobTemplateRequest + * @throws {Error} If the payload is not 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.transcoder.v1.DeleteJobTemplateRequest; + + /** + * Decodes a DeleteJobTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobTemplateRequest + * @throws {Error} If the payload 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.transcoder.v1.DeleteJobTemplateRequest; + + /** + * Verifies a DeleteJobTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.DeleteJobTemplateRequest; + + /** + * Creates a plain object from a DeleteJobTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteJobTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.DeleteJobTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobTemplatesResponse. */ + interface IListJobTemplatesResponse { + + /** ListJobTemplatesResponse jobTemplates */ + jobTemplates?: (google.cloud.video.transcoder.v1.IJobTemplate[]|null); + + /** ListJobTemplatesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobTemplatesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobTemplatesResponse. */ + class ListJobTemplatesResponse implements IListJobTemplatesResponse { + + /** + * Constructs a new ListJobTemplatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.video.transcoder.v1.IListJobTemplatesResponse); + + /** ListJobTemplatesResponse jobTemplates. */ + public jobTemplates: google.cloud.video.transcoder.v1.IJobTemplate[]; + + /** ListJobTemplatesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobTemplatesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobTemplatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobTemplatesResponse instance + */ + public static create(properties?: google.cloud.video.transcoder.v1.IListJobTemplatesResponse): google.cloud.video.transcoder.v1.ListJobTemplatesResponse; + + /** + * Encodes the specified ListJobTemplatesResponse message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesResponse.verify|verify} messages. + * @param message ListJobTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.video.transcoder.v1.IListJobTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesResponse.verify|verify} messages. + * @param message ListJobTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.video.transcoder.v1.IListJobTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobTemplatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobTemplatesResponse + * @throws {Error} If the payload is not 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.transcoder.v1.ListJobTemplatesResponse; + + /** + * Decodes a ListJobTemplatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobTemplatesResponse + * @throws {Error} If the payload 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.transcoder.v1.ListJobTemplatesResponse; + + /** + * Verifies a ListJobTemplatesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobTemplatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.video.transcoder.v1.ListJobTemplatesResponse; + + /** + * Creates a plain object from a ListJobTemplatesResponse message. Also converts values to other types if specified. + * @param message ListJobTemplatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.video.transcoder.v1.ListJobTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobTemplatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobTemplatesResponse + * @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); + } + + /** 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; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-video-transcoder/protos/protos.js b/packages/google-cloud-video-transcoder/protos/protos.js new file mode 100644 index 00000000000..165044a87d3 --- /dev/null +++ b/packages/google-cloud-video-transcoder/protos/protos.js @@ -0,0 +1,26345 @@ +// 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_video_transcoder_protos || ($protobuf.roots._google_cloud_video_transcoder_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.transcoder = (function() { + + /** + * Namespace transcoder. + * @memberof google.cloud.video + * @namespace + */ + var transcoder = {}; + + transcoder.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.video.transcoder + * @namespace + */ + var v1 = {}; + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.video.transcoder.v1 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [inputUri] Job inputUri + * @property {string|null} [outputUri] Job outputUri + * @property {string|null} [templateId] Job templateId + * @property {google.cloud.video.transcoder.v1.IJobConfig|null} [config] Job config + * @property {google.cloud.video.transcoder.v1.Job.ProcessingState|null} [state] Job state + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {google.protobuf.ITimestamp|null} [startTime] Job startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Job endTime + * @property {number|null} [ttlAfterCompletionDays] Job ttlAfterCompletionDays + * @property {Object.|null} [labels] Job labels + * @property {google.rpc.IStatus|null} [error] Job error + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.video.transcoder.v1.IJob=} [properties] Properties to set + */ + function Job(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]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job inputUri. + * @member {string} inputUri + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.inputUri = ""; + + /** + * Job outputUri. + * @member {string} outputUri + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.outputUri = ""; + + /** + * Job templateId. + * @member {string|null|undefined} templateId + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.templateId = null; + + /** + * Job config. + * @member {google.cloud.video.transcoder.v1.IJobConfig|null|undefined} config + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.config = null; + + /** + * Job state. + * @member {google.cloud.video.transcoder.v1.Job.ProcessingState} state + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.state = 0; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.startTime = null; + + /** + * Job endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.endTime = null; + + /** + * Job ttlAfterCompletionDays. + * @member {number} ttlAfterCompletionDays + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.ttlAfterCompletionDays = 0; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Job.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Job jobConfig. + * @member {"templateId"|"config"|undefined} jobConfig + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + */ + Object.defineProperty(Job.prototype, "jobConfig", { + get: $util.oneOfGetter($oneOfFields = ["templateId", "config"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {google.cloud.video.transcoder.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.video.transcoder.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {google.cloud.video.transcoder.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputUri); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputUri); + if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.templateId); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.video.transcoder.v1.JobConfig.encode(message.config, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.ttlAfterCompletionDays != null && Object.hasOwnProperty.call(message, "ttlAfterCompletionDays")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.ttlAfterCompletionDays); + 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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {google.cloud.video.transcoder.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.transcoder.v1.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputUri = reader.string(); + break; + } + case 3: { + message.outputUri = reader.string(); + break; + } + case 4: { + message.templateId = reader.string(); + break; + } + case 5: { + message.config = $root.google.cloud.video.transcoder.v1.JobConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 12: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.ttlAfterCompletionDays = reader.int32(); + break; + } + case 16: { + 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 17: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.templateId != null && message.hasOwnProperty("templateId")) { + properties.jobConfig = 1; + if (!$util.isString(message.templateId)) + return "templateId: string expected"; + } + if (message.config != null && message.hasOwnProperty("config")) { + if (properties.jobConfig === 1) + return "jobConfig: multiple values"; + properties.jobConfig = 1; + { + var error = $root.google.cloud.video.transcoder.v1.JobConfig.verify(message.config); + if (error) + return "config." + 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: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.ttlAfterCompletionDays != null && message.hasOwnProperty("ttlAfterCompletionDays")) + if (!$util.isInteger(message.ttlAfterCompletionDays)) + return "ttlAfterCompletionDays: integer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Job) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.templateId != null) + message.templateId = String(object.templateId); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Job.config: object expected"); + message.config = $root.google.cloud.video.transcoder.v1.JobConfig.fromObject(object.config); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "PROCESSING_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + 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; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Job.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Job.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Job.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.ttlAfterCompletionDays != null) + message.ttlAfterCompletionDays = object.ttlAfterCompletionDays | 0; + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Job.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.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Job.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {google.cloud.video.transcoder.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.inputUri = ""; + object.outputUri = ""; + object.state = options.enums === String ? "PROCESSING_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.ttlAfterCompletionDays = 0; + object.error = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.templateId != null && message.hasOwnProperty("templateId")) { + object.templateId = message.templateId; + if (options.oneofs) + object.jobConfig = "templateId"; + } + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.video.transcoder.v1.JobConfig.toObject(message.config, options); + if (options.oneofs) + object.jobConfig = "config"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.video.transcoder.v1.Job.ProcessingState[message.state] === undefined ? message.state : $root.google.cloud.video.transcoder.v1.Job.ProcessingState[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.ttlAfterCompletionDays != null && message.hasOwnProperty("ttlAfterCompletionDays")) + object.ttlAfterCompletionDays = message.ttlAfterCompletionDays; + 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.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Job"; + }; + + /** + * ProcessingState enum. + * @name google.cloud.video.transcoder.v1.Job.ProcessingState + * @enum {number} + * @property {number} PROCESSING_STATE_UNSPECIFIED=0 PROCESSING_STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + Job.ProcessingState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROCESSING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return Job; + })(); + + v1.JobTemplate = (function() { + + /** + * Properties of a JobTemplate. + * @memberof google.cloud.video.transcoder.v1 + * @interface IJobTemplate + * @property {string|null} [name] JobTemplate name + * @property {google.cloud.video.transcoder.v1.IJobConfig|null} [config] JobTemplate config + * @property {Object.|null} [labels] JobTemplate labels + */ + + /** + * Constructs a new JobTemplate. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a JobTemplate. + * @implements IJobTemplate + * @constructor + * @param {google.cloud.video.transcoder.v1.IJobTemplate=} [properties] Properties to set + */ + function JobTemplate(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]]; + } + + /** + * JobTemplate name. + * @member {string} name + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @instance + */ + JobTemplate.prototype.name = ""; + + /** + * JobTemplate config. + * @member {google.cloud.video.transcoder.v1.IJobConfig|null|undefined} config + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @instance + */ + JobTemplate.prototype.config = null; + + /** + * JobTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @instance + */ + JobTemplate.prototype.labels = $util.emptyObject; + + /** + * Creates a new JobTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {google.cloud.video.transcoder.v1.IJobTemplate=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.JobTemplate} JobTemplate instance + */ + JobTemplate.create = function create(properties) { + return new JobTemplate(properties); + }; + + /** + * Encodes the specified JobTemplate message. Does not implicitly {@link google.cloud.video.transcoder.v1.JobTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {google.cloud.video.transcoder.v1.IJobTemplate} message JobTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobTemplate.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.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.video.transcoder.v1.JobConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).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 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobTemplate message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.JobTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {google.cloud.video.transcoder.v1.IJobTemplate} message JobTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.JobTemplate} JobTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobTemplate.decode = function 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.transcoder.v1.JobTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.config = $root.google.cloud.video.transcoder.v1.JobConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.JobTemplate} JobTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobTemplate message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobTemplate.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.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.video.transcoder.v1.JobConfig.verify(message.config); + if (error) + return "config." + 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"; + } + return null; + }; + + /** + * Creates a JobTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.JobTemplate} JobTemplate + */ + JobTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.JobTemplate) + return object; + var message = new $root.google.cloud.video.transcoder.v1.JobTemplate(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobTemplate.config: object expected"); + message.config = $root.google.cloud.video.transcoder.v1.JobConfig.fromObject(object.config); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobTemplate.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a JobTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {google.cloud.video.transcoder.v1.JobTemplate} message JobTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.config = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.video.transcoder.v1.JobConfig.toObject(message.config, 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]]; + } + return object; + }; + + /** + * Converts this JobTemplate to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @instance + * @returns {Object.} JSON object + */ + JobTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobTemplate + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.JobTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.JobTemplate"; + }; + + return JobTemplate; + })(); + + v1.JobConfig = (function() { + + /** + * Properties of a JobConfig. + * @memberof google.cloud.video.transcoder.v1 + * @interface IJobConfig + * @property {Array.|null} [inputs] JobConfig inputs + * @property {Array.|null} [editList] JobConfig editList + * @property {Array.|null} [elementaryStreams] JobConfig elementaryStreams + * @property {Array.|null} [muxStreams] JobConfig muxStreams + * @property {Array.|null} [manifests] JobConfig manifests + * @property {google.cloud.video.transcoder.v1.IOutput|null} [output] JobConfig output + * @property {Array.|null} [adBreaks] JobConfig adBreaks + * @property {google.cloud.video.transcoder.v1.IPubsubDestination|null} [pubsubDestination] JobConfig pubsubDestination + * @property {Array.|null} [spriteSheets] JobConfig spriteSheets + * @property {Array.|null} [overlays] JobConfig overlays + */ + + /** + * Constructs a new JobConfig. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a JobConfig. + * @implements IJobConfig + * @constructor + * @param {google.cloud.video.transcoder.v1.IJobConfig=} [properties] Properties to set + */ + function JobConfig(properties) { + this.inputs = []; + this.editList = []; + this.elementaryStreams = []; + this.muxStreams = []; + this.manifests = []; + this.adBreaks = []; + this.spriteSheets = []; + this.overlays = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobConfig inputs. + * @member {Array.} inputs + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.inputs = $util.emptyArray; + + /** + * JobConfig editList. + * @member {Array.} editList + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.editList = $util.emptyArray; + + /** + * JobConfig elementaryStreams. + * @member {Array.} elementaryStreams + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.elementaryStreams = $util.emptyArray; + + /** + * JobConfig muxStreams. + * @member {Array.} muxStreams + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.muxStreams = $util.emptyArray; + + /** + * JobConfig manifests. + * @member {Array.} manifests + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.manifests = $util.emptyArray; + + /** + * JobConfig output. + * @member {google.cloud.video.transcoder.v1.IOutput|null|undefined} output + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.output = null; + + /** + * JobConfig adBreaks. + * @member {Array.} adBreaks + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.adBreaks = $util.emptyArray; + + /** + * JobConfig pubsubDestination. + * @member {google.cloud.video.transcoder.v1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.pubsubDestination = null; + + /** + * JobConfig spriteSheets. + * @member {Array.} spriteSheets + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.spriteSheets = $util.emptyArray; + + /** + * JobConfig overlays. + * @member {Array.} overlays + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + */ + JobConfig.prototype.overlays = $util.emptyArray; + + /** + * Creates a new JobConfig instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {google.cloud.video.transcoder.v1.IJobConfig=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.JobConfig} JobConfig instance + */ + JobConfig.create = function create(properties) { + return new JobConfig(properties); + }; + + /** + * Encodes the specified JobConfig message. Does not implicitly {@link google.cloud.video.transcoder.v1.JobConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {google.cloud.video.transcoder.v1.IJobConfig} message JobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfig.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.transcoder.v1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.editList != null && message.editList.length) + for (var i = 0; i < message.editList.length; ++i) + $root.google.cloud.video.transcoder.v1.EditAtom.encode(message.editList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.elementaryStreams != null && message.elementaryStreams.length) + for (var i = 0; i < message.elementaryStreams.length; ++i) + $root.google.cloud.video.transcoder.v1.ElementaryStream.encode(message.elementaryStreams[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.muxStreams != null && message.muxStreams.length) + for (var i = 0; i < message.muxStreams.length; ++i) + $root.google.cloud.video.transcoder.v1.MuxStream.encode(message.muxStreams[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.manifests != null && message.manifests.length) + for (var i = 0; i < message.manifests.length; ++i) + $root.google.cloud.video.transcoder.v1.Manifest.encode(message.manifests[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + $root.google.cloud.video.transcoder.v1.Output.encode(message.output, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.adBreaks != null && message.adBreaks.length) + for (var i = 0; i < message.adBreaks.length; ++i) + $root.google.cloud.video.transcoder.v1.AdBreak.encode(message.adBreaks[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pubsubDestination != null && Object.hasOwnProperty.call(message, "pubsubDestination")) + $root.google.cloud.video.transcoder.v1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.spriteSheets != null && message.spriteSheets.length) + for (var i = 0; i < message.spriteSheets.length; ++i) + $root.google.cloud.video.transcoder.v1.SpriteSheet.encode(message.spriteSheets[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.overlays != null && message.overlays.length) + for (var i = 0; i < message.overlays.length; ++i) + $root.google.cloud.video.transcoder.v1.Overlay.encode(message.overlays[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobConfig message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.JobConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {google.cloud.video.transcoder.v1.IJobConfig} message JobConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.JobConfig} JobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfig.decode = function 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.transcoder.v1.JobConfig(); + 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.transcoder.v1.Input.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.editList && message.editList.length)) + message.editList = []; + message.editList.push($root.google.cloud.video.transcoder.v1.EditAtom.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.elementaryStreams && message.elementaryStreams.length)) + message.elementaryStreams = []; + message.elementaryStreams.push($root.google.cloud.video.transcoder.v1.ElementaryStream.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.muxStreams && message.muxStreams.length)) + message.muxStreams = []; + message.muxStreams.push($root.google.cloud.video.transcoder.v1.MuxStream.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.manifests && message.manifests.length)) + message.manifests = []; + message.manifests.push($root.google.cloud.video.transcoder.v1.Manifest.decode(reader, reader.uint32())); + break; + } + case 6: { + message.output = $root.google.cloud.video.transcoder.v1.Output.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.adBreaks && message.adBreaks.length)) + message.adBreaks = []; + message.adBreaks.push($root.google.cloud.video.transcoder.v1.AdBreak.decode(reader, reader.uint32())); + break; + } + case 8: { + message.pubsubDestination = $root.google.cloud.video.transcoder.v1.PubsubDestination.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.spriteSheets && message.spriteSheets.length)) + message.spriteSheets = []; + message.spriteSheets.push($root.google.cloud.video.transcoder.v1.SpriteSheet.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.overlays && message.overlays.length)) + message.overlays = []; + message.overlays.push($root.google.cloud.video.transcoder.v1.Overlay.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.JobConfig} JobConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobConfig message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobConfig.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.transcoder.v1.Input.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.editList != null && message.hasOwnProperty("editList")) { + if (!Array.isArray(message.editList)) + return "editList: array expected"; + for (var i = 0; i < message.editList.length; ++i) { + var error = $root.google.cloud.video.transcoder.v1.EditAtom.verify(message.editList[i]); + if (error) + return "editList." + 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.transcoder.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.transcoder.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.transcoder.v1.Manifest.verify(message.manifests[i]); + if (error) + return "manifests." + error; + } + } + if (message.output != null && message.hasOwnProperty("output")) { + var error = $root.google.cloud.video.transcoder.v1.Output.verify(message.output); + if (error) + return "output." + error; + } + if (message.adBreaks != null && message.hasOwnProperty("adBreaks")) { + if (!Array.isArray(message.adBreaks)) + return "adBreaks: array expected"; + for (var i = 0; i < message.adBreaks.length; ++i) { + var error = $root.google.cloud.video.transcoder.v1.AdBreak.verify(message.adBreaks[i]); + if (error) + return "adBreaks." + error; + } + } + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + var error = $root.google.cloud.video.transcoder.v1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + 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.transcoder.v1.SpriteSheet.verify(message.spriteSheets[i]); + if (error) + return "spriteSheets." + error; + } + } + if (message.overlays != null && message.hasOwnProperty("overlays")) { + if (!Array.isArray(message.overlays)) + return "overlays: array expected"; + for (var i = 0; i < message.overlays.length; ++i) { + var error = $root.google.cloud.video.transcoder.v1.Overlay.verify(message.overlays[i]); + if (error) + return "overlays." + error; + } + } + return null; + }; + + /** + * Creates a JobConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.JobConfig} JobConfig + */ + JobConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.JobConfig) + return object; + var message = new $root.google.cloud.video.transcoder.v1.JobConfig(); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.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.transcoder.v1.JobConfig.inputs: object expected"); + message.inputs[i] = $root.google.cloud.video.transcoder.v1.Input.fromObject(object.inputs[i]); + } + } + if (object.editList) { + if (!Array.isArray(object.editList)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.editList: array expected"); + message.editList = []; + for (var i = 0; i < object.editList.length; ++i) { + if (typeof object.editList[i] !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.editList: object expected"); + message.editList[i] = $root.google.cloud.video.transcoder.v1.EditAtom.fromObject(object.editList[i]); + } + } + if (object.elementaryStreams) { + if (!Array.isArray(object.elementaryStreams)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.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.transcoder.v1.JobConfig.elementaryStreams: object expected"); + message.elementaryStreams[i] = $root.google.cloud.video.transcoder.v1.ElementaryStream.fromObject(object.elementaryStreams[i]); + } + } + if (object.muxStreams) { + if (!Array.isArray(object.muxStreams)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.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.transcoder.v1.JobConfig.muxStreams: object expected"); + message.muxStreams[i] = $root.google.cloud.video.transcoder.v1.MuxStream.fromObject(object.muxStreams[i]); + } + } + if (object.manifests) { + if (!Array.isArray(object.manifests)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.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.transcoder.v1.JobConfig.manifests: object expected"); + message.manifests[i] = $root.google.cloud.video.transcoder.v1.Manifest.fromObject(object.manifests[i]); + } + } + if (object.output != null) { + if (typeof object.output !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.output: object expected"); + message.output = $root.google.cloud.video.transcoder.v1.Output.fromObject(object.output); + } + if (object.adBreaks) { + if (!Array.isArray(object.adBreaks)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.adBreaks: array expected"); + message.adBreaks = []; + for (var i = 0; i < object.adBreaks.length; ++i) { + if (typeof object.adBreaks[i] !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.adBreaks: object expected"); + message.adBreaks[i] = $root.google.cloud.video.transcoder.v1.AdBreak.fromObject(object.adBreaks[i]); + } + } + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.video.transcoder.v1.PubsubDestination.fromObject(object.pubsubDestination); + } + if (object.spriteSheets) { + if (!Array.isArray(object.spriteSheets)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.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.transcoder.v1.JobConfig.spriteSheets: object expected"); + message.spriteSheets[i] = $root.google.cloud.video.transcoder.v1.SpriteSheet.fromObject(object.spriteSheets[i]); + } + } + if (object.overlays) { + if (!Array.isArray(object.overlays)) + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.overlays: array expected"); + message.overlays = []; + for (var i = 0; i < object.overlays.length; ++i) { + if (typeof object.overlays[i] !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.JobConfig.overlays: object expected"); + message.overlays[i] = $root.google.cloud.video.transcoder.v1.Overlay.fromObject(object.overlays[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a JobConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {google.cloud.video.transcoder.v1.JobConfig} message JobConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputs = []; + object.editList = []; + object.elementaryStreams = []; + object.muxStreams = []; + object.manifests = []; + object.adBreaks = []; + object.spriteSheets = []; + object.overlays = []; + } + if (options.defaults) { + object.output = null; + object.pubsubDestination = null; + } + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.cloud.video.transcoder.v1.Input.toObject(message.inputs[j], options); + } + if (message.editList && message.editList.length) { + object.editList = []; + for (var j = 0; j < message.editList.length; ++j) + object.editList[j] = $root.google.cloud.video.transcoder.v1.EditAtom.toObject(message.editList[j], 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.transcoder.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.transcoder.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.transcoder.v1.Manifest.toObject(message.manifests[j], options); + } + if (message.output != null && message.hasOwnProperty("output")) + object.output = $root.google.cloud.video.transcoder.v1.Output.toObject(message.output, options); + if (message.adBreaks && message.adBreaks.length) { + object.adBreaks = []; + for (var j = 0; j < message.adBreaks.length; ++j) + object.adBreaks[j] = $root.google.cloud.video.transcoder.v1.AdBreak.toObject(message.adBreaks[j], options); + } + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) + object.pubsubDestination = $root.google.cloud.video.transcoder.v1.PubsubDestination.toObject(message.pubsubDestination, 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.transcoder.v1.SpriteSheet.toObject(message.spriteSheets[j], options); + } + if (message.overlays && message.overlays.length) { + object.overlays = []; + for (var j = 0; j < message.overlays.length; ++j) + object.overlays[j] = $root.google.cloud.video.transcoder.v1.Overlay.toObject(message.overlays[j], options); + } + return object; + }; + + /** + * Converts this JobConfig to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @instance + * @returns {Object.} JSON object + */ + JobConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobConfig + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.JobConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.JobConfig"; + }; + + return JobConfig; + })(); + + v1.Input = (function() { + + /** + * Properties of an Input. + * @memberof google.cloud.video.transcoder.v1 + * @interface IInput + * @property {string|null} [key] Input key + * @property {string|null} [uri] Input uri + * @property {google.cloud.video.transcoder.v1.IPreprocessingConfig|null} [preprocessingConfig] Input preprocessingConfig + */ + + /** + * Constructs a new Input. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents an Input. + * @implements IInput + * @constructor + * @param {google.cloud.video.transcoder.v1.IInput=} [properties] Properties to set + */ + function Input(properties) { + if (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 key. + * @member {string} key + * @memberof google.cloud.video.transcoder.v1.Input + * @instance + */ + Input.prototype.key = ""; + + /** + * Input uri. + * @member {string} uri + * @memberof google.cloud.video.transcoder.v1.Input + * @instance + */ + Input.prototype.uri = ""; + + /** + * Input preprocessingConfig. + * @member {google.cloud.video.transcoder.v1.IPreprocessingConfig|null|undefined} preprocessingConfig + * @memberof google.cloud.video.transcoder.v1.Input + * @instance + */ + Input.prototype.preprocessingConfig = null; + + /** + * Creates a new Input instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Input + * @static + * @param {google.cloud.video.transcoder.v1.IInput=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.Input.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Input + * @static + * @param {google.cloud.video.transcoder.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.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.preprocessingConfig != null && Object.hasOwnProperty.call(message, "preprocessingConfig")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.encode(message.preprocessingConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Input message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Input.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Input + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.Input(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.preprocessingConfig = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.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.transcoder.v1.Input + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + 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.transcoder.v1.PreprocessingConfig.verify(message.preprocessingConfig); + if (error) + return "preprocessingConfig." + 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.transcoder.v1.Input + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Input} Input + */ + Input.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Input) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Input(); + if (object.key != null) + message.key = String(object.key); + if (object.uri != null) + message.uri = String(object.uri); + if (object.preprocessingConfig != null) { + if (typeof object.preprocessingConfig !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Input.preprocessingConfig: object expected"); + message.preprocessingConfig = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.fromObject(object.preprocessingConfig); + } + return message; + }; + + /** + * Creates a plain object from an Input message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Input + * @static + * @param {google.cloud.video.transcoder.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.defaults) { + object.key = ""; + object.uri = ""; + object.preprocessingConfig = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.preprocessingConfig != null && message.hasOwnProperty("preprocessingConfig")) + object.preprocessingConfig = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.toObject(message.preprocessingConfig, options); + return object; + }; + + /** + * Converts this Input to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.Input"; + }; + + return Input; + })(); + + v1.Output = (function() { + + /** + * Properties of an Output. + * @memberof google.cloud.video.transcoder.v1 + * @interface IOutput + * @property {string|null} [uri] Output uri + */ + + /** + * Constructs a new Output. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents an Output. + * @implements IOutput + * @constructor + * @param {google.cloud.video.transcoder.v1.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.transcoder.v1.Output + * @instance + */ + Output.prototype.uri = ""; + + /** + * Creates a new Output instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Output + * @static + * @param {google.cloud.video.transcoder.v1.IOutput=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Output} Output instance + */ + Output.create = function create(properties) { + return new Output(properties); + }; + + /** + * Encodes the specified Output message. Does not implicitly {@link google.cloud.video.transcoder.v1.Output.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Output + * @static + * @param {google.cloud.video.transcoder.v1.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.transcoder.v1.Output.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Output + * @static + * @param {google.cloud.video.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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.transcoder.v1.Output + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.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.transcoder.v1.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.transcoder.v1.Output + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Output} Output + */ + Output.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Output) + return object; + var message = new $root.google.cloud.video.transcoder.v1.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.transcoder.v1.Output + * @static + * @param {google.cloud.video.transcoder.v1.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.transcoder.v1.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.transcoder.v1.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.transcoder.v1.Output"; + }; + + return Output; + })(); + + v1.EditAtom = (function() { + + /** + * Properties of an EditAtom. + * @memberof google.cloud.video.transcoder.v1 + * @interface IEditAtom + * @property {string|null} [key] EditAtom key + * @property {Array.|null} [inputs] EditAtom inputs + * @property {google.protobuf.IDuration|null} [endTimeOffset] EditAtom endTimeOffset + * @property {google.protobuf.IDuration|null} [startTimeOffset] EditAtom startTimeOffset + */ + + /** + * Constructs a new EditAtom. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents an EditAtom. + * @implements IEditAtom + * @constructor + * @param {google.cloud.video.transcoder.v1.IEditAtom=} [properties] Properties to set + */ + function EditAtom(properties) { + this.inputs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditAtom key. + * @member {string} key + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @instance + */ + EditAtom.prototype.key = ""; + + /** + * EditAtom inputs. + * @member {Array.} inputs + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @instance + */ + EditAtom.prototype.inputs = $util.emptyArray; + + /** + * EditAtom endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @instance + */ + EditAtom.prototype.endTimeOffset = null; + + /** + * EditAtom startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @instance + */ + EditAtom.prototype.startTimeOffset = null; + + /** + * Creates a new EditAtom instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {google.cloud.video.transcoder.v1.IEditAtom=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.EditAtom} EditAtom instance + */ + EditAtom.create = function create(properties) { + return new EditAtom(properties); + }; + + /** + * Encodes the specified EditAtom message. Does not implicitly {@link google.cloud.video.transcoder.v1.EditAtom.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {google.cloud.video.transcoder.v1.IEditAtom} message EditAtom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditAtom.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.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputs[i]); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EditAtom message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.EditAtom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {google.cloud.video.transcoder.v1.IEditAtom} message EditAtom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditAtom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditAtom message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.EditAtom} EditAtom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditAtom.decode = function 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.transcoder.v1.EditAtom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push(reader.string()); + break; + } + case 3: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditAtom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.EditAtom} EditAtom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditAtom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditAtom message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditAtom.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.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) + if (!$util.isString(message.inputs[i])) + return "inputs: string[] expected"; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + return null; + }; + + /** + * Creates an EditAtom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.EditAtom} EditAtom + */ + EditAtom.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.EditAtom) + return object; + var message = new $root.google.cloud.video.transcoder.v1.EditAtom(); + if (object.key != null) + message.key = String(object.key); + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.cloud.video.transcoder.v1.EditAtom.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) + message.inputs[i] = String(object.inputs[i]); + } + if (object.endTimeOffset != null) { + if (typeof object.endTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.EditAtom.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.EditAtom.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from an EditAtom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {google.cloud.video.transcoder.v1.EditAtom} message EditAtom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditAtom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputs = []; + if (options.defaults) { + object.key = ""; + object.endTimeOffset = null; + object.startTimeOffset = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = message.inputs[j]; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) + object.endTimeOffset = $root.google.protobuf.Duration.toObject(message.endTimeOffset, options); + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + return object; + }; + + /** + * Converts this EditAtom to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @instance + * @returns {Object.} JSON object + */ + EditAtom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditAtom + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.EditAtom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditAtom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.EditAtom"; + }; + + return EditAtom; + })(); + + v1.AdBreak = (function() { + + /** + * Properties of an AdBreak. + * @memberof google.cloud.video.transcoder.v1 + * @interface IAdBreak + * @property {google.protobuf.IDuration|null} [startTimeOffset] AdBreak startTimeOffset + */ + + /** + * Constructs a new AdBreak. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents an AdBreak. + * @implements IAdBreak + * @constructor + * @param {google.cloud.video.transcoder.v1.IAdBreak=} [properties] Properties to set + */ + function AdBreak(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdBreak startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @instance + */ + AdBreak.prototype.startTimeOffset = null; + + /** + * Creates a new AdBreak instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {google.cloud.video.transcoder.v1.IAdBreak=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.AdBreak} AdBreak instance + */ + AdBreak.create = function create(properties) { + return new AdBreak(properties); + }; + + /** + * Encodes the specified AdBreak message. Does not implicitly {@link google.cloud.video.transcoder.v1.AdBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {google.cloud.video.transcoder.v1.IAdBreak} message AdBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdBreak.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AdBreak message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.AdBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {google.cloud.video.transcoder.v1.IAdBreak} message AdBreak message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdBreak.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdBreak message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.AdBreak} AdBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdBreak.decode = function 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.transcoder.v1.AdBreak(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdBreak message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.AdBreak} AdBreak + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdBreak.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdBreak message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdBreak.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + return null; + }; + + /** + * Creates an AdBreak message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.AdBreak} AdBreak + */ + AdBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.AdBreak) + return object; + var message = new $root.google.cloud.video.transcoder.v1.AdBreak(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.AdBreak.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from an AdBreak message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {google.cloud.video.transcoder.v1.AdBreak} message AdBreak + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdBreak.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTimeOffset = null; + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + return object; + }; + + /** + * Converts this AdBreak to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @instance + * @returns {Object.} JSON object + */ + AdBreak.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdBreak + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.AdBreak + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdBreak.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.AdBreak"; + }; + + return AdBreak; + })(); + + v1.ElementaryStream = (function() { + + /** + * Properties of an ElementaryStream. + * @memberof google.cloud.video.transcoder.v1 + * @interface IElementaryStream + * @property {string|null} [key] ElementaryStream key + * @property {google.cloud.video.transcoder.v1.IVideoStream|null} [videoStream] ElementaryStream videoStream + * @property {google.cloud.video.transcoder.v1.IAudioStream|null} [audioStream] ElementaryStream audioStream + * @property {google.cloud.video.transcoder.v1.ITextStream|null} [textStream] ElementaryStream textStream + */ + + /** + * Constructs a new ElementaryStream. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents an ElementaryStream. + * @implements IElementaryStream + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.key = ""; + + /** + * ElementaryStream videoStream. + * @member {google.cloud.video.transcoder.v1.IVideoStream|null|undefined} videoStream + * @memberof google.cloud.video.transcoder.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.videoStream = null; + + /** + * ElementaryStream audioStream. + * @member {google.cloud.video.transcoder.v1.IAudioStream|null|undefined} audioStream + * @memberof google.cloud.video.transcoder.v1.ElementaryStream + * @instance + */ + ElementaryStream.prototype.audioStream = null; + + /** + * ElementaryStream textStream. + * @member {google.cloud.video.transcoder.v1.ITextStream|null|undefined} textStream + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.ElementaryStream + * @static + * @param {google.cloud.video.transcoder.v1.IElementaryStream=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.ElementaryStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.ElementaryStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.ElementaryStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.ElementaryStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.VideoStream.decode(reader, reader.uint32()); + break; + } + case 2: { + message.audioStream = $root.google.cloud.video.transcoder.v1.AudioStream.decode(reader, reader.uint32()); + break; + } + case 3: { + message.textStream = $root.google.cloud.video.transcoder.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.transcoder.v1.ElementaryStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.ElementaryStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.ElementaryStream} ElementaryStream + */ + ElementaryStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.ElementaryStream) + return object; + var message = new $root.google.cloud.video.transcoder.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.transcoder.v1.ElementaryStream.videoStream: object expected"); + message.videoStream = $root.google.cloud.video.transcoder.v1.VideoStream.fromObject(object.videoStream); + } + if (object.audioStream != null) { + if (typeof object.audioStream !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.ElementaryStream.audioStream: object expected"); + message.audioStream = $root.google.cloud.video.transcoder.v1.AudioStream.fromObject(object.audioStream); + } + if (object.textStream != null) { + if (typeof object.textStream !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.ElementaryStream.textStream: object expected"); + message.textStream = $root.google.cloud.video.transcoder.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.transcoder.v1.ElementaryStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.ElementaryStream"; + }; + + return ElementaryStream; + })(); + + v1.MuxStream = (function() { + + /** + * Properties of a MuxStream. + * @memberof google.cloud.video.transcoder.v1 + * @interface IMuxStream + * @property {string|null} [key] MuxStream key + * @property {string|null} [fileName] MuxStream fileName + * @property {string|null} [container] MuxStream container + * @property {Array.|null} [elementaryStreams] MuxStream elementaryStreams + * @property {google.cloud.video.transcoder.v1.ISegmentSettings|null} [segmentSettings] MuxStream segmentSettings + */ + + /** + * Constructs a new MuxStream. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a MuxStream. + * @implements IMuxStream + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.MuxStream + * @instance + */ + MuxStream.prototype.key = ""; + + /** + * MuxStream fileName. + * @member {string} fileName + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @instance + */ + MuxStream.prototype.fileName = ""; + + /** + * MuxStream container. + * @member {string} container + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @instance + */ + MuxStream.prototype.container = ""; + + /** + * MuxStream elementaryStreams. + * @member {Array.} elementaryStreams + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @instance + */ + MuxStream.prototype.elementaryStreams = $util.emptyArray; + + /** + * MuxStream segmentSettings. + * @member {google.cloud.video.transcoder.v1.ISegmentSettings|null|undefined} segmentSettings + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @instance + */ + MuxStream.prototype.segmentSettings = null; + + /** + * Creates a new MuxStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @static + * @param {google.cloud.video.transcoder.v1.IMuxStream=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.MuxStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @static + * @param {google.cloud.video.transcoder.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.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fileName); + 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.transcoder.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.transcoder.v1.MuxStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.MuxStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.MuxStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.fileName = 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.transcoder.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.transcoder.v1.MuxStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: 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.transcoder.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.transcoder.v1.MuxStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.MuxStream} MuxStream + */ + MuxStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.MuxStream) + return object; + var message = new $root.google.cloud.video.transcoder.v1.MuxStream(); + if (object.key != null) + message.key = String(object.key); + if (object.fileName != null) + message.fileName = String(object.fileName); + if (object.container != null) + message.container = String(object.container); + if (object.elementaryStreams) { + if (!Array.isArray(object.elementaryStreams)) + throw TypeError(".google.cloud.video.transcoder.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.transcoder.v1.MuxStream.segmentSettings: object expected"); + message.segmentSettings = $root.google.cloud.video.transcoder.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.transcoder.v1.MuxStream + * @static + * @param {google.cloud.video.transcoder.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.fileName = ""; + object.container = ""; + object.segmentSettings = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + 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.transcoder.v1.SegmentSettings.toObject(message.segmentSettings, options); + return object; + }; + + /** + * Converts this MuxStream to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.MuxStream"; + }; + + return MuxStream; + })(); + + v1.Manifest = (function() { + + /** + * Properties of a Manifest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IManifest + * @property {string|null} [fileName] Manifest fileName + * @property {google.cloud.video.transcoder.v1.Manifest.ManifestType|null} [type] Manifest type + * @property {Array.|null} [muxStreams] Manifest muxStreams + */ + + /** + * Constructs a new Manifest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a Manifest. + * @implements IManifest + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.Manifest + * @instance + */ + Manifest.prototype.fileName = ""; + + /** + * Manifest type. + * @member {google.cloud.video.transcoder.v1.Manifest.ManifestType} type + * @memberof google.cloud.video.transcoder.v1.Manifest + * @instance + */ + Manifest.prototype.type = 0; + + /** + * Manifest muxStreams. + * @member {Array.} muxStreams + * @memberof google.cloud.video.transcoder.v1.Manifest + * @instance + */ + Manifest.prototype.muxStreams = $util.emptyArray; + + /** + * Creates a new Manifest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Manifest + * @static + * @param {google.cloud.video.transcoder.v1.IManifest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.Manifest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Manifest + * @static + * @param {google.cloud.video.transcoder.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]); + return writer; + }; + + /** + * Encodes the specified Manifest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Manifest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Manifest + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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; + } + 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.transcoder.v1.Manifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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"; + } + return null; + }; + + /** + * Creates a Manifest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Manifest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Manifest} Manifest + */ + Manifest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Manifest) + return object; + var message = new $root.google.cloud.video.transcoder.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.transcoder.v1.Manifest.muxStreams: array expected"); + message.muxStreams = []; + for (var i = 0; i < object.muxStreams.length; ++i) + message.muxStreams[i] = String(object.muxStreams[i]); + } + return message; + }; + + /** + * Creates a plain object from a Manifest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Manifest + * @static + * @param {google.cloud.video.transcoder.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; + } + 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.transcoder.v1.Manifest.ManifestType[message.type] === undefined ? message.type : $root.google.cloud.video.transcoder.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]; + } + return object; + }; + + /** + * Converts this Manifest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.Manifest"; + }; + + /** + * ManifestType enum. + * @name google.cloud.video.transcoder.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.PubsubDestination = (function() { + + /** + * Properties of a PubsubDestination. + * @memberof google.cloud.video.transcoder.v1 + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic + */ + + /** + * Constructs a new PubsubDestination. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination + * @constructor + * @param {google.cloud.video.transcoder.v1.IPubsubDestination=} [properties] Properties to set + */ + function PubsubDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @instance + */ + PubsubDestination.prototype.topic = ""; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {google.cloud.video.transcoder.v1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.PubsubDestination} PubsubDestination instance + */ + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); + }; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.video.transcoder.v1.PubsubDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {google.cloud.video.transcoder.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PubsubDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {google.cloud.video.transcoder.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decode = function 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.transcoder.v1.PubsubDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubDestination message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PubsubDestination} PubsubDestination + */ + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PubsubDestination) + return object; + var message = new $root.google.cloud.video.transcoder.v1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {google.cloud.video.transcoder.v1.PubsubDestination} message PubsubDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this PubsubDestination to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @instance + * @returns {Object.} JSON object + */ + PubsubDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubDestination + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.PubsubDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.PubsubDestination"; + }; + + return PubsubDestination; + })(); + + v1.SpriteSheet = (function() { + + /** + * Properties of a SpriteSheet. + * @memberof google.cloud.video.transcoder.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} [startTimeOffset] SpriteSheet startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] SpriteSheet endTimeOffset + * @property {number|null} [totalCount] SpriteSheet totalCount + * @property {google.protobuf.IDuration|null} [interval] SpriteSheet interval + * @property {number|null} [quality] SpriteSheet quality + */ + + /** + * Constructs a new SpriteSheet. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a SpriteSheet. + * @implements ISpriteSheet + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.format = ""; + + /** + * SpriteSheet filePrefix. + * @member {string} filePrefix + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.filePrefix = ""; + + /** + * SpriteSheet spriteWidthPixels. + * @member {number} spriteWidthPixels + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.spriteWidthPixels = 0; + + /** + * SpriteSheet spriteHeightPixels. + * @member {number} spriteHeightPixels + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.spriteHeightPixels = 0; + + /** + * SpriteSheet columnCount. + * @member {number} columnCount + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.columnCount = 0; + + /** + * SpriteSheet rowCount. + * @member {number} rowCount + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.rowCount = 0; + + /** + * SpriteSheet startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.startTimeOffset = null; + + /** + * SpriteSheet endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.endTimeOffset = null; + + /** + * SpriteSheet totalCount. + * @member {number|null|undefined} totalCount + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.totalCount = null; + + /** + * SpriteSheet interval. + * @member {google.protobuf.IDuration|null|undefined} interval + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.interval = null; + + /** + * SpriteSheet quality. + * @member {number} quality + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + SpriteSheet.prototype.quality = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpriteSheet extractionStrategy. + * @member {"totalCount"|"interval"|undefined} extractionStrategy + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @instance + */ + Object.defineProperty(SpriteSheet.prototype, "extractionStrategy", { + get: $util.oneOfGetter($oneOfFields = ["totalCount", "interval"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpriteSheet instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @static + * @param {google.cloud.video.transcoder.v1.ISpriteSheet=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.SpriteSheet.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @static + * @param {google.cloud.video.transcoder.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.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.totalCount != null && Object.hasOwnProperty.call(message, "totalCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.totalCount); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.protobuf.Duration.encode(message.interval, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.quality != null && Object.hasOwnProperty.call(message, "quality")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.quality); + return writer; + }; + + /** + * Encodes the specified SpriteSheet message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.SpriteSheet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.SpriteSheet + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.totalCount = reader.int32(); + break; + } + case 10: { + message.interval = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 11: { + 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.transcoder.v1.SpriteSheet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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"; + var properties = {}; + 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.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + if (message.totalCount != null && message.hasOwnProperty("totalCount")) { + properties.extractionStrategy = 1; + if (!$util.isInteger(message.totalCount)) + return "totalCount: integer expected"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + if (properties.extractionStrategy === 1) + return "extractionStrategy: multiple values"; + properties.extractionStrategy = 1; + { + 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.transcoder.v1.SpriteSheet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.SpriteSheet} SpriteSheet + */ + SpriteSheet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.SpriteSheet) + return object; + var message = new $root.google.cloud.video.transcoder.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.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.SpriteSheet.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + if (object.endTimeOffset != null) { + if (typeof object.endTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.SpriteSheet.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + if (object.totalCount != null) + message.totalCount = object.totalCount | 0; + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.video.transcoder.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.transcoder.v1.SpriteSheet + * @static + * @param {google.cloud.video.transcoder.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.startTimeOffset = null; + object.endTimeOffset = 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.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) + object.endTimeOffset = $root.google.protobuf.Duration.toObject(message.endTimeOffset, options); + if (message.totalCount != null && message.hasOwnProperty("totalCount")) { + object.totalCount = message.totalCount; + if (options.oneofs) + object.extractionStrategy = "totalCount"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + object.interval = $root.google.protobuf.Duration.toObject(message.interval, options); + if (options.oneofs) + object.extractionStrategy = "interval"; + } + if (message.quality != null && message.hasOwnProperty("quality")) + object.quality = message.quality; + return object; + }; + + /** + * Converts this SpriteSheet to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.SpriteSheet"; + }; + + return SpriteSheet; + })(); + + v1.Overlay = (function() { + + /** + * Properties of an Overlay. + * @memberof google.cloud.video.transcoder.v1 + * @interface IOverlay + * @property {google.cloud.video.transcoder.v1.Overlay.IImage|null} [image] Overlay image + * @property {Array.|null} [animations] Overlay animations + */ + + /** + * Constructs a new Overlay. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents an Overlay. + * @implements IOverlay + * @constructor + * @param {google.cloud.video.transcoder.v1.IOverlay=} [properties] Properties to set + */ + function Overlay(properties) { + this.animations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Overlay image. + * @member {google.cloud.video.transcoder.v1.Overlay.IImage|null|undefined} image + * @memberof google.cloud.video.transcoder.v1.Overlay + * @instance + */ + Overlay.prototype.image = null; + + /** + * Overlay animations. + * @member {Array.} animations + * @memberof google.cloud.video.transcoder.v1.Overlay + * @instance + */ + Overlay.prototype.animations = $util.emptyArray; + + /** + * Creates a new Overlay instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {google.cloud.video.transcoder.v1.IOverlay=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay} Overlay instance + */ + Overlay.create = function create(properties) { + return new Overlay(properties); + }; + + /** + * Encodes the specified Overlay message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {google.cloud.video.transcoder.v1.IOverlay} message Overlay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Overlay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.video.transcoder.v1.Overlay.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.animations != null && message.animations.length) + for (var i = 0; i < message.animations.length; ++i) + $root.google.cloud.video.transcoder.v1.Overlay.Animation.encode(message.animations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Overlay message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {google.cloud.video.transcoder.v1.IOverlay} message Overlay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Overlay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Overlay message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay} Overlay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Overlay.decode = function 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.transcoder.v1.Overlay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = $root.google.cloud.video.transcoder.v1.Overlay.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.animations && message.animations.length)) + message.animations = []; + message.animations.push($root.google.cloud.video.transcoder.v1.Overlay.Animation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Overlay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay} Overlay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Overlay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Overlay message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Overlay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.video.transcoder.v1.Overlay.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.animations != null && message.hasOwnProperty("animations")) { + if (!Array.isArray(message.animations)) + return "animations: array expected"; + for (var i = 0; i < message.animations.length; ++i) { + var error = $root.google.cloud.video.transcoder.v1.Overlay.Animation.verify(message.animations[i]); + if (error) + return "animations." + error; + } + } + return null; + }; + + /** + * Creates an Overlay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay} Overlay + */ + Overlay.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.image: object expected"); + message.image = $root.google.cloud.video.transcoder.v1.Overlay.Image.fromObject(object.image); + } + if (object.animations) { + if (!Array.isArray(object.animations)) + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.animations: array expected"); + message.animations = []; + for (var i = 0; i < object.animations.length; ++i) { + if (typeof object.animations[i] !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.animations: object expected"); + message.animations[i] = $root.google.cloud.video.transcoder.v1.Overlay.Animation.fromObject(object.animations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Overlay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {google.cloud.video.transcoder.v1.Overlay} message Overlay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Overlay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.animations = []; + if (options.defaults) + object.image = null; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.video.transcoder.v1.Overlay.Image.toObject(message.image, options); + if (message.animations && message.animations.length) { + object.animations = []; + for (var j = 0; j < message.animations.length; ++j) + object.animations[j] = $root.google.cloud.video.transcoder.v1.Overlay.Animation.toObject(message.animations[j], options); + } + return object; + }; + + /** + * Converts this Overlay to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay + * @instance + * @returns {Object.} JSON object + */ + Overlay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Overlay + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Overlay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay"; + }; + + Overlay.NormalizedCoordinate = (function() { + + /** + * Properties of a NormalizedCoordinate. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @interface INormalizedCoordinate + * @property {number|null} [x] NormalizedCoordinate x + * @property {number|null} [y] NormalizedCoordinate y + */ + + /** + * Constructs a new NormalizedCoordinate. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @classdesc Represents a NormalizedCoordinate. + * @implements INormalizedCoordinate + * @constructor + * @param {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate=} [properties] Properties to set + */ + function NormalizedCoordinate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedCoordinate x. + * @member {number} x + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @instance + */ + NormalizedCoordinate.prototype.x = 0; + + /** + * NormalizedCoordinate y. + * @member {number} y + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @instance + */ + NormalizedCoordinate.prototype.y = 0; + + /** + * Creates a new NormalizedCoordinate instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate} NormalizedCoordinate instance + */ + NormalizedCoordinate.create = function create(properties) { + return new NormalizedCoordinate(properties); + }; + + /** + * Encodes the specified NormalizedCoordinate message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate} message NormalizedCoordinate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedCoordinate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedCoordinate message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate} message NormalizedCoordinate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedCoordinate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedCoordinate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate} NormalizedCoordinate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedCoordinate.decode = function 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.transcoder.v1.Overlay.NormalizedCoordinate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.double(); + break; + } + case 2: { + message.y = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedCoordinate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate} NormalizedCoordinate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedCoordinate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedCoordinate message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedCoordinate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a NormalizedCoordinate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate} NormalizedCoordinate + */ + NormalizedCoordinate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a NormalizedCoordinate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate} message NormalizedCoordinate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedCoordinate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this NormalizedCoordinate to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @instance + * @returns {Object.} JSON object + */ + NormalizedCoordinate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedCoordinate + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedCoordinate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"; + }; + + return NormalizedCoordinate; + })(); + + Overlay.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @interface IImage + * @property {string|null} [uri] Image uri + * @property {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null} [resolution] Image resolution + * @property {number|null} [alpha] Image alpha + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.video.transcoder.v1.Overlay.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image uri. + * @member {string} uri + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @instance + */ + Image.prototype.uri = ""; + + /** + * Image resolution. + * @member {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null|undefined} resolution + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @instance + */ + Image.prototype.resolution = null; + + /** + * Image alpha. + * @member {number} alpha + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @instance + */ + Image.prototype.alpha = 0; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IImage=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.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); + if (message.resolution != null && Object.hasOwnProperty.call(message, "resolution")) + $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.encode(message.resolution, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.alpha != null && Object.hasOwnProperty.call(message, "alpha")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.alpha); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function 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.transcoder.v1.Overlay.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.resolution = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.decode(reader, reader.uint32()); + break; + } + case 3: { + message.alpha = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.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"; + if (message.resolution != null && message.hasOwnProperty("resolution")) { + var error = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify(message.resolution); + if (error) + return "resolution." + error; + } + if (message.alpha != null && message.hasOwnProperty("alpha")) + if (typeof message.alpha !== "number") + return "alpha: number expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay.Image) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay.Image(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.resolution != null) { + if (typeof object.resolution !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.Image.resolution: object expected"); + message.resolution = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.fromObject(object.resolution); + } + if (object.alpha != null) + message.alpha = Number(object.alpha); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.resolution = null; + object.alpha = 0; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.resolution != null && message.hasOwnProperty("resolution")) + object.resolution = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.toObject(message.resolution, options); + if (message.alpha != null && message.hasOwnProperty("alpha")) + object.alpha = options.json && !isFinite(message.alpha) ? String(message.alpha) : message.alpha; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay.Image"; + }; + + return Image; + })(); + + Overlay.AnimationStatic = (function() { + + /** + * Properties of an AnimationStatic. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @interface IAnimationStatic + * @property {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null} [xy] AnimationStatic xy + * @property {google.protobuf.IDuration|null} [startTimeOffset] AnimationStatic startTimeOffset + */ + + /** + * Constructs a new AnimationStatic. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @classdesc Represents an AnimationStatic. + * @implements IAnimationStatic + * @constructor + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationStatic=} [properties] Properties to set + */ + function AnimationStatic(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnimationStatic xy. + * @member {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null|undefined} xy + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @instance + */ + AnimationStatic.prototype.xy = null; + + /** + * AnimationStatic startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @instance + */ + AnimationStatic.prototype.startTimeOffset = null; + + /** + * Creates a new AnimationStatic instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationStatic=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationStatic} AnimationStatic instance + */ + AnimationStatic.create = function create(properties) { + return new AnimationStatic(properties); + }; + + /** + * Encodes the specified AnimationStatic message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationStatic.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationStatic} message AnimationStatic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnimationStatic.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xy != null && Object.hasOwnProperty.call(message, "xy")) + $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.encode(message.xy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnimationStatic message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationStatic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationStatic} message AnimationStatic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnimationStatic.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnimationStatic message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationStatic} AnimationStatic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnimationStatic.decode = function 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.transcoder.v1.Overlay.AnimationStatic(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xy = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnimationStatic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationStatic} AnimationStatic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnimationStatic.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnimationStatic message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnimationStatic.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xy != null && message.hasOwnProperty("xy")) { + var error = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify(message.xy); + if (error) + return "xy." + error; + } + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + return null; + }; + + /** + * Creates an AnimationStatic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationStatic} AnimationStatic + */ + AnimationStatic.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic(); + if (object.xy != null) { + if (typeof object.xy !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.AnimationStatic.xy: object expected"); + message.xy = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.fromObject(object.xy); + } + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.AnimationStatic.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from an AnimationStatic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.AnimationStatic} message AnimationStatic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnimationStatic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xy = null; + object.startTimeOffset = null; + } + if (message.xy != null && message.hasOwnProperty("xy")) + object.xy = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.toObject(message.xy, options); + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + return object; + }; + + /** + * Converts this AnimationStatic to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @instance + * @returns {Object.} JSON object + */ + AnimationStatic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnimationStatic + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationStatic + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnimationStatic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"; + }; + + return AnimationStatic; + })(); + + /** + * FadeType enum. + * @name google.cloud.video.transcoder.v1.Overlay.FadeType + * @enum {number} + * @property {number} FADE_TYPE_UNSPECIFIED=0 FADE_TYPE_UNSPECIFIED value + * @property {number} FADE_IN=1 FADE_IN value + * @property {number} FADE_OUT=2 FADE_OUT value + */ + Overlay.FadeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FADE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FADE_IN"] = 1; + values[valuesById[2] = "FADE_OUT"] = 2; + return values; + })(); + + Overlay.AnimationFade = (function() { + + /** + * Properties of an AnimationFade. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @interface IAnimationFade + * @property {google.cloud.video.transcoder.v1.Overlay.FadeType|null} [fadeType] AnimationFade fadeType + * @property {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null} [xy] AnimationFade xy + * @property {google.protobuf.IDuration|null} [startTimeOffset] AnimationFade startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] AnimationFade endTimeOffset + */ + + /** + * Constructs a new AnimationFade. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @classdesc Represents an AnimationFade. + * @implements IAnimationFade + * @constructor + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationFade=} [properties] Properties to set + */ + function AnimationFade(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnimationFade fadeType. + * @member {google.cloud.video.transcoder.v1.Overlay.FadeType} fadeType + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @instance + */ + AnimationFade.prototype.fadeType = 0; + + /** + * AnimationFade xy. + * @member {google.cloud.video.transcoder.v1.Overlay.INormalizedCoordinate|null|undefined} xy + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @instance + */ + AnimationFade.prototype.xy = null; + + /** + * AnimationFade startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @instance + */ + AnimationFade.prototype.startTimeOffset = null; + + /** + * AnimationFade endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @instance + */ + AnimationFade.prototype.endTimeOffset = null; + + /** + * Creates a new AnimationFade instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationFade=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationFade} AnimationFade instance + */ + AnimationFade.create = function create(properties) { + return new AnimationFade(properties); + }; + + /** + * Encodes the specified AnimationFade message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationFade.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationFade} message AnimationFade message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnimationFade.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fadeType != null && Object.hasOwnProperty.call(message, "fadeType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fadeType); + if (message.xy != null && Object.hasOwnProperty.call(message, "xy")) + $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.encode(message.xy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnimationFade message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationFade.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationFade} message AnimationFade message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnimationFade.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnimationFade message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationFade} AnimationFade + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnimationFade.decode = function 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.transcoder.v1.Overlay.AnimationFade(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fadeType = reader.int32(); + break; + } + case 2: { + message.xy = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.decode(reader, reader.uint32()); + break; + } + case 3: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnimationFade message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationFade} AnimationFade + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnimationFade.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnimationFade message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnimationFade.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fadeType != null && message.hasOwnProperty("fadeType")) + switch (message.fadeType) { + default: + return "fadeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.xy != null && message.hasOwnProperty("xy")) { + var error = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.verify(message.xy); + if (error) + return "xy." + error; + } + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates an AnimationFade message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationFade} AnimationFade + */ + AnimationFade.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade(); + switch (object.fadeType) { + default: + if (typeof object.fadeType === "number") { + message.fadeType = object.fadeType; + break; + } + break; + case "FADE_TYPE_UNSPECIFIED": + case 0: + message.fadeType = 0; + break; + case "FADE_IN": + case 1: + message.fadeType = 1; + break; + case "FADE_OUT": + case 2: + message.fadeType = 2; + break; + } + if (object.xy != null) { + if (typeof object.xy !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.AnimationFade.xy: object expected"); + message.xy = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.fromObject(object.xy); + } + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.AnimationFade.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + if (object.endTimeOffset != null) { + if (typeof object.endTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.AnimationFade.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from an AnimationFade message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.AnimationFade} message AnimationFade + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnimationFade.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fadeType = options.enums === String ? "FADE_TYPE_UNSPECIFIED" : 0; + object.xy = null; + object.startTimeOffset = null; + object.endTimeOffset = null; + } + if (message.fadeType != null && message.hasOwnProperty("fadeType")) + object.fadeType = options.enums === String ? $root.google.cloud.video.transcoder.v1.Overlay.FadeType[message.fadeType] === undefined ? message.fadeType : $root.google.cloud.video.transcoder.v1.Overlay.FadeType[message.fadeType] : message.fadeType; + if (message.xy != null && message.hasOwnProperty("xy")) + object.xy = $root.google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate.toObject(message.xy, options); + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) + object.endTimeOffset = $root.google.protobuf.Duration.toObject(message.endTimeOffset, options); + return object; + }; + + /** + * Converts this AnimationFade to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @instance + * @returns {Object.} JSON object + */ + AnimationFade.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnimationFade + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationFade + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnimationFade.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay.AnimationFade"; + }; + + return AnimationFade; + })(); + + Overlay.AnimationEnd = (function() { + + /** + * Properties of an AnimationEnd. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @interface IAnimationEnd + * @property {google.protobuf.IDuration|null} [startTimeOffset] AnimationEnd startTimeOffset + */ + + /** + * Constructs a new AnimationEnd. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @classdesc Represents an AnimationEnd. + * @implements IAnimationEnd + * @constructor + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationEnd=} [properties] Properties to set + */ + function AnimationEnd(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnimationEnd startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @instance + */ + AnimationEnd.prototype.startTimeOffset = null; + + /** + * Creates a new AnimationEnd instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationEnd=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationEnd} AnimationEnd instance + */ + AnimationEnd.create = function create(properties) { + return new AnimationEnd(properties); + }; + + /** + * Encodes the specified AnimationEnd message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationEnd.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationEnd} message AnimationEnd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnimationEnd.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnimationEnd message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.AnimationEnd.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimationEnd} message AnimationEnd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnimationEnd.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnimationEnd message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationEnd} AnimationEnd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnimationEnd.decode = function 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.transcoder.v1.Overlay.AnimationEnd(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnimationEnd message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationEnd} AnimationEnd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnimationEnd.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnimationEnd message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnimationEnd.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + return null; + }; + + /** + * Creates an AnimationEnd message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay.AnimationEnd} AnimationEnd + */ + AnimationEnd.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.AnimationEnd.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from an AnimationEnd message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.AnimationEnd} message AnimationEnd + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnimationEnd.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTimeOffset = null; + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + return object; + }; + + /** + * Converts this AnimationEnd to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @instance + * @returns {Object.} JSON object + */ + AnimationEnd.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnimationEnd + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay.AnimationEnd + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnimationEnd.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"; + }; + + return AnimationEnd; + })(); + + Overlay.Animation = (function() { + + /** + * Properties of an Animation. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @interface IAnimation + * @property {google.cloud.video.transcoder.v1.Overlay.IAnimationStatic|null} [animationStatic] Animation animationStatic + * @property {google.cloud.video.transcoder.v1.Overlay.IAnimationFade|null} [animationFade] Animation animationFade + * @property {google.cloud.video.transcoder.v1.Overlay.IAnimationEnd|null} [animationEnd] Animation animationEnd + */ + + /** + * Constructs a new Animation. + * @memberof google.cloud.video.transcoder.v1.Overlay + * @classdesc Represents an Animation. + * @implements IAnimation + * @constructor + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimation=} [properties] Properties to set + */ + function Animation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Animation animationStatic. + * @member {google.cloud.video.transcoder.v1.Overlay.IAnimationStatic|null|undefined} animationStatic + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @instance + */ + Animation.prototype.animationStatic = null; + + /** + * Animation animationFade. + * @member {google.cloud.video.transcoder.v1.Overlay.IAnimationFade|null|undefined} animationFade + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @instance + */ + Animation.prototype.animationFade = null; + + /** + * Animation animationEnd. + * @member {google.cloud.video.transcoder.v1.Overlay.IAnimationEnd|null|undefined} animationEnd + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @instance + */ + Animation.prototype.animationEnd = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Animation animationType. + * @member {"animationStatic"|"animationFade"|"animationEnd"|undefined} animationType + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @instance + */ + Object.defineProperty(Animation.prototype, "animationType", { + get: $util.oneOfGetter($oneOfFields = ["animationStatic", "animationFade", "animationEnd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Animation instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimation=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.Overlay.Animation} Animation instance + */ + Animation.create = function create(properties) { + return new Animation(properties); + }; + + /** + * Encodes the specified Animation message. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Animation.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimation} message Animation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Animation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.animationStatic != null && Object.hasOwnProperty.call(message, "animationStatic")) + $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic.encode(message.animationStatic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.animationFade != null && Object.hasOwnProperty.call(message, "animationFade")) + $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade.encode(message.animationFade, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.animationEnd != null && Object.hasOwnProperty.call(message, "animationEnd")) + $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd.encode(message.animationEnd, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Animation message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Overlay.Animation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.IAnimation} message Animation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Animation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Animation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.Overlay.Animation} Animation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Animation.decode = function 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.transcoder.v1.Overlay.Animation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.animationStatic = $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic.decode(reader, reader.uint32()); + break; + } + case 2: { + message.animationFade = $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade.decode(reader, reader.uint32()); + break; + } + case 3: { + message.animationEnd = $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Animation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.Overlay.Animation} Animation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Animation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Animation message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Animation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.animationStatic != null && message.hasOwnProperty("animationStatic")) { + properties.animationType = 1; + { + var error = $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic.verify(message.animationStatic); + if (error) + return "animationStatic." + error; + } + } + if (message.animationFade != null && message.hasOwnProperty("animationFade")) { + if (properties.animationType === 1) + return "animationType: multiple values"; + properties.animationType = 1; + { + var error = $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade.verify(message.animationFade); + if (error) + return "animationFade." + error; + } + } + if (message.animationEnd != null && message.hasOwnProperty("animationEnd")) { + if (properties.animationType === 1) + return "animationType: multiple values"; + properties.animationType = 1; + { + var error = $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd.verify(message.animationEnd); + if (error) + return "animationEnd." + error; + } + } + return null; + }; + + /** + * Creates an Animation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.Overlay.Animation} Animation + */ + Animation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.Overlay.Animation) + return object; + var message = new $root.google.cloud.video.transcoder.v1.Overlay.Animation(); + if (object.animationStatic != null) { + if (typeof object.animationStatic !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.Animation.animationStatic: object expected"); + message.animationStatic = $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic.fromObject(object.animationStatic); + } + if (object.animationFade != null) { + if (typeof object.animationFade !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.Animation.animationFade: object expected"); + message.animationFade = $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade.fromObject(object.animationFade); + } + if (object.animationEnd != null) { + if (typeof object.animationEnd !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.Overlay.Animation.animationEnd: object expected"); + message.animationEnd = $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd.fromObject(object.animationEnd); + } + return message; + }; + + /** + * Creates a plain object from an Animation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {google.cloud.video.transcoder.v1.Overlay.Animation} message Animation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Animation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.animationStatic != null && message.hasOwnProperty("animationStatic")) { + object.animationStatic = $root.google.cloud.video.transcoder.v1.Overlay.AnimationStatic.toObject(message.animationStatic, options); + if (options.oneofs) + object.animationType = "animationStatic"; + } + if (message.animationFade != null && message.hasOwnProperty("animationFade")) { + object.animationFade = $root.google.cloud.video.transcoder.v1.Overlay.AnimationFade.toObject(message.animationFade, options); + if (options.oneofs) + object.animationType = "animationFade"; + } + if (message.animationEnd != null && message.hasOwnProperty("animationEnd")) { + object.animationEnd = $root.google.cloud.video.transcoder.v1.Overlay.AnimationEnd.toObject(message.animationEnd, options); + if (options.oneofs) + object.animationType = "animationEnd"; + } + return object; + }; + + /** + * Converts this Animation to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @instance + * @returns {Object.} JSON object + */ + Animation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Animation + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.Overlay.Animation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Animation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Overlay.Animation"; + }; + + return Animation; + })(); + + return Overlay; + })(); + + v1.PreprocessingConfig = (function() { + + /** + * Properties of a PreprocessingConfig. + * @memberof google.cloud.video.transcoder.v1 + * @interface IPreprocessingConfig + * @property {google.cloud.video.transcoder.v1.PreprocessingConfig.IColor|null} [color] PreprocessingConfig color + * @property {google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise|null} [denoise] PreprocessingConfig denoise + * @property {google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock|null} [deblock] PreprocessingConfig deblock + * @property {google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio|null} [audio] PreprocessingConfig audio + * @property {google.cloud.video.transcoder.v1.PreprocessingConfig.ICrop|null} [crop] PreprocessingConfig crop + * @property {google.cloud.video.transcoder.v1.PreprocessingConfig.IPad|null} [pad] PreprocessingConfig pad + */ + + /** + * Constructs a new PreprocessingConfig. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a PreprocessingConfig. + * @implements IPreprocessingConfig + * @constructor + * @param {google.cloud.video.transcoder.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 color. + * @member {google.cloud.video.transcoder.v1.PreprocessingConfig.IColor|null|undefined} color + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.color = null; + + /** + * PreprocessingConfig denoise. + * @member {google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise|null|undefined} denoise + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.denoise = null; + + /** + * PreprocessingConfig deblock. + * @member {google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock|null|undefined} deblock + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.deblock = null; + + /** + * PreprocessingConfig audio. + * @member {google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio|null|undefined} audio + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.audio = null; + + /** + * PreprocessingConfig crop. + * @member {google.cloud.video.transcoder.v1.PreprocessingConfig.ICrop|null|undefined} crop + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.crop = null; + + /** + * PreprocessingConfig pad. + * @member {google.cloud.video.transcoder.v1.PreprocessingConfig.IPad|null|undefined} pad + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @instance + */ + PreprocessingConfig.prototype.pad = null; + + /** + * Creates a new PreprocessingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.transcoder.v1.IPreprocessingConfig=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.transcoder.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.color != null && Object.hasOwnProperty.call(message, "color")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color.encode(message.color, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.denoise != null && Object.hasOwnProperty.call(message, "denoise")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.encode(message.denoise, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deblock != null && Object.hasOwnProperty.call(message, "deblock")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.encode(message.deblock, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.encode(message.audio, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.crop != null && Object.hasOwnProperty.call(message, "crop")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Crop.encode(message.crop, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pad != null && Object.hasOwnProperty.call(message, "pad")) + $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Pad.encode(message.pad, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreprocessingConfig message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.color = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color.decode(reader, reader.uint32()); + break; + } + case 2: { + message.denoise = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.decode(reader, reader.uint32()); + break; + } + case 3: { + message.deblock = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.decode(reader, reader.uint32()); + break; + } + case 4: { + message.audio = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.decode(reader, reader.uint32()); + break; + } + case 5: { + message.crop = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Crop.decode(reader, reader.uint32()); + break; + } + case 6: { + message.pad = $root.google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.color != null && message.hasOwnProperty("color")) { + var error = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color.verify(message.color); + if (error) + return "color." + error; + } + if (message.denoise != null && message.hasOwnProperty("denoise")) { + var error = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.verify(message.denoise); + if (error) + return "denoise." + error; + } + if (message.deblock != null && message.hasOwnProperty("deblock")) { + var error = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.verify(message.deblock); + if (error) + return "deblock." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + var error = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.verify(message.audio); + if (error) + return "audio." + error; + } + if (message.crop != null && message.hasOwnProperty("crop")) { + var error = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Crop.verify(message.crop); + if (error) + return "crop." + error; + } + if (message.pad != null && message.hasOwnProperty("pad")) { + var error = $root.google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig} PreprocessingConfig + */ + PreprocessingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig) + return object; + var message = new $root.google.cloud.video.transcoder.v1.PreprocessingConfig(); + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.PreprocessingConfig.color: object expected"); + message.color = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color.fromObject(object.color); + } + if (object.denoise != null) { + if (typeof object.denoise !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.PreprocessingConfig.denoise: object expected"); + message.denoise = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.fromObject(object.denoise); + } + if (object.deblock != null) { + if (typeof object.deblock !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.PreprocessingConfig.deblock: object expected"); + message.deblock = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.fromObject(object.deblock); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.PreprocessingConfig.audio: object expected"); + message.audio = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.fromObject(object.audio); + } + if (object.crop != null) { + if (typeof object.crop !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.PreprocessingConfig.crop: object expected"); + message.crop = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Crop.fromObject(object.crop); + } + if (object.pad != null) { + if (typeof object.pad !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.PreprocessingConfig.pad: object expected"); + message.pad = $root.google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig + * @static + * @param {google.cloud.video.transcoder.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.color = null; + object.denoise = null; + object.deblock = null; + object.audio = null; + object.crop = null; + object.pad = null; + } + if (message.color != null && message.hasOwnProperty("color")) + object.color = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color.toObject(message.color, options); + if (message.denoise != null && message.hasOwnProperty("denoise")) + object.denoise = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.toObject(message.denoise, options); + if (message.deblock != null && message.hasOwnProperty("deblock")) + object.deblock = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.toObject(message.deblock, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.toObject(message.audio, options); + if (message.crop != null && message.hasOwnProperty("crop")) + object.crop = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Crop.toObject(message.crop, options); + if (message.pad != null && message.hasOwnProperty("pad")) + object.pad = $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Pad.toObject(message.pad, options); + return object; + }; + + /** + * Converts this PreprocessingConfig to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig"; + }; + + PreprocessingConfig.Color = (function() { + + /** + * Properties of a Color. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @interface IColor + * @property {number|null} [saturation] Color saturation + * @property {number|null} [contrast] Color contrast + * @property {number|null} [brightness] Color brightness + */ + + /** + * Constructs a new Color. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @classdesc Represents a Color. + * @implements IColor + * @constructor + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IColor=} [properties] Properties to set + */ + function Color(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Color saturation. + * @member {number} saturation + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @instance + */ + Color.prototype.saturation = 0; + + /** + * Color contrast. + * @member {number} contrast + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @instance + */ + Color.prototype.contrast = 0; + + /** + * Color brightness. + * @member {number} brightness + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @instance + */ + Color.prototype.brightness = 0; + + /** + * Creates a new Color instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IColor=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Color} Color instance + */ + Color.create = function create(properties) { + return new Color(properties); + }; + + /** + * Encodes the specified Color message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Color.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.saturation != null && Object.hasOwnProperty.call(message, "saturation")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.saturation); + if (message.contrast != null && Object.hasOwnProperty.call(message, "contrast")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.contrast); + if (message.brightness != null && Object.hasOwnProperty.call(message, "brightness")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.brightness); + return writer; + }; + + /** + * Encodes the specified Color message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Color.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IColor} message Color message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Color.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Color message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.decode = function 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.transcoder.v1.PreprocessingConfig.Color(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.saturation = reader.double(); + break; + } + case 2: { + message.contrast = reader.double(); + break; + } + case 3: { + message.brightness = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Color message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Color} Color + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Color.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Color message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Color.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.saturation != null && message.hasOwnProperty("saturation")) + if (typeof message.saturation !== "number") + return "saturation: number expected"; + if (message.contrast != null && message.hasOwnProperty("contrast")) + if (typeof message.contrast !== "number") + return "contrast: number expected"; + if (message.brightness != null && message.hasOwnProperty("brightness")) + if (typeof message.brightness !== "number") + return "brightness: number expected"; + return null; + }; + + /** + * Creates a Color message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Color} Color + */ + Color.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color) + return object; + var message = new $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Color(); + if (object.saturation != null) + message.saturation = Number(object.saturation); + if (object.contrast != null) + message.contrast = Number(object.contrast); + if (object.brightness != null) + message.brightness = Number(object.brightness); + return message; + }; + + /** + * Creates a plain object from a Color message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.Color} message Color + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Color.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.saturation = 0; + object.contrast = 0; + object.brightness = 0; + } + if (message.saturation != null && message.hasOwnProperty("saturation")) + object.saturation = options.json && !isFinite(message.saturation) ? String(message.saturation) : message.saturation; + if (message.contrast != null && message.hasOwnProperty("contrast")) + object.contrast = options.json && !isFinite(message.contrast) ? String(message.contrast) : message.contrast; + if (message.brightness != null && message.hasOwnProperty("brightness")) + object.brightness = options.json && !isFinite(message.brightness) ? String(message.brightness) : message.brightness; + return object; + }; + + /** + * Converts this Color to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @instance + * @returns {Object.} JSON object + */ + Color.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Color + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Color + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Color.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"; + }; + + return Color; + })(); + + PreprocessingConfig.Denoise = (function() { + + /** + * Properties of a Denoise. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @interface IDenoise + * @property {number|null} [strength] Denoise strength + * @property {string|null} [tune] Denoise tune + */ + + /** + * Constructs a new Denoise. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @classdesc Represents a Denoise. + * @implements IDenoise + * @constructor + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise=} [properties] Properties to set + */ + function Denoise(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Denoise strength. + * @member {number} strength + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @instance + */ + Denoise.prototype.strength = 0; + + /** + * Denoise tune. + * @member {string} tune + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @instance + */ + Denoise.prototype.tune = ""; + + /** + * Creates a new Denoise instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise} Denoise instance + */ + Denoise.create = function create(properties) { + return new Denoise(properties); + }; + + /** + * Encodes the specified Denoise message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise} message Denoise message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Denoise.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strength != null && Object.hasOwnProperty.call(message, "strength")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.strength); + if (message.tune != null && Object.hasOwnProperty.call(message, "tune")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tune); + return writer; + }; + + /** + * Encodes the specified Denoise message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDenoise} message Denoise message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Denoise.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Denoise message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise} Denoise + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Denoise.decode = function 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.transcoder.v1.PreprocessingConfig.Denoise(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.strength = reader.double(); + break; + } + case 2: { + message.tune = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Denoise message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise} Denoise + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Denoise.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Denoise message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Denoise.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.strength != null && message.hasOwnProperty("strength")) + if (typeof message.strength !== "number") + return "strength: number expected"; + if (message.tune != null && message.hasOwnProperty("tune")) + if (!$util.isString(message.tune)) + return "tune: string expected"; + return null; + }; + + /** + * Creates a Denoise message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise} Denoise + */ + Denoise.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise) + return object; + var message = new $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise(); + if (object.strength != null) + message.strength = Number(object.strength); + if (object.tune != null) + message.tune = String(object.tune); + return message; + }; + + /** + * Creates a plain object from a Denoise message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise} message Denoise + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Denoise.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.strength = 0; + object.tune = ""; + } + if (message.strength != null && message.hasOwnProperty("strength")) + object.strength = options.json && !isFinite(message.strength) ? String(message.strength) : message.strength; + if (message.tune != null && message.hasOwnProperty("tune")) + object.tune = message.tune; + return object; + }; + + /** + * Converts this Denoise to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @instance + * @returns {Object.} JSON object + */ + Denoise.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Denoise + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Denoise.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"; + }; + + return Denoise; + })(); + + PreprocessingConfig.Deblock = (function() { + + /** + * Properties of a Deblock. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @interface IDeblock + * @property {number|null} [strength] Deblock strength + * @property {boolean|null} [enabled] Deblock enabled + */ + + /** + * Constructs a new Deblock. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @classdesc Represents a Deblock. + * @implements IDeblock + * @constructor + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock=} [properties] Properties to set + */ + function Deblock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deblock strength. + * @member {number} strength + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @instance + */ + Deblock.prototype.strength = 0; + + /** + * Deblock enabled. + * @member {boolean} enabled + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @instance + */ + Deblock.prototype.enabled = false; + + /** + * Creates a new Deblock instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock} Deblock instance + */ + Deblock.create = function create(properties) { + return new Deblock(properties); + }; + + /** + * Encodes the specified Deblock message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock} message Deblock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deblock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strength != null && Object.hasOwnProperty.call(message, "strength")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.strength); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified Deblock message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IDeblock} message Deblock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deblock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deblock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock} Deblock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deblock.decode = function 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.transcoder.v1.PreprocessingConfig.Deblock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.strength = reader.double(); + break; + } + case 2: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deblock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock} Deblock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deblock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deblock message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deblock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.strength != null && message.hasOwnProperty("strength")) + if (typeof message.strength !== "number") + return "strength: number expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a Deblock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock} Deblock + */ + Deblock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock) + return object; + var message = new $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock(); + if (object.strength != null) + message.strength = Number(object.strength); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a Deblock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock} message Deblock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deblock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.strength = 0; + object.enabled = false; + } + if (message.strength != null && message.hasOwnProperty("strength")) + object.strength = options.json && !isFinite(message.strength) ? String(message.strength) : message.strength; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this Deblock to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @instance + * @returns {Object.} JSON object + */ + Deblock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deblock + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deblock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"; + }; + + return Deblock; + })(); + + PreprocessingConfig.Audio = (function() { + + /** + * Properties of an Audio. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @interface IAudio + * @property {number|null} [lufs] Audio lufs + * @property {boolean|null} [highBoost] Audio highBoost + * @property {boolean|null} [lowBoost] Audio lowBoost + */ + + /** + * Constructs a new Audio. + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig + * @classdesc Represents an Audio. + * @implements IAudio + * @constructor + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio=} [properties] Properties to set + */ + function Audio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Audio lufs. + * @member {number} lufs + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @instance + */ + Audio.prototype.lufs = 0; + + /** + * Audio highBoost. + * @member {boolean} highBoost + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @instance + */ + Audio.prototype.highBoost = false; + + /** + * Audio lowBoost. + * @member {boolean} lowBoost + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @instance + */ + Audio.prototype.lowBoost = false; + + /** + * Creates a new Audio instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Audio} Audio instance + */ + Audio.create = function create(properties) { + return new Audio(properties); + }; + + /** + * Encodes the specified Audio message. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio} message Audio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Audio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lufs != null && Object.hasOwnProperty.call(message, "lufs")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.lufs); + if (message.highBoost != null && Object.hasOwnProperty.call(message, "highBoost")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.highBoost); + if (message.lowBoost != null && Object.hasOwnProperty.call(message, "lowBoost")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.lowBoost); + return writer; + }; + + /** + * Encodes the specified Audio message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.PreprocessingConfig.Audio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IAudio} message Audio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Audio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Audio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Audio} Audio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Audio.decode = function 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.transcoder.v1.PreprocessingConfig.Audio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lufs = reader.double(); + break; + } + case 2: { + message.highBoost = reader.bool(); + break; + } + case 3: { + message.lowBoost = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Audio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Audio} Audio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Audio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Audio message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Audio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lufs != null && message.hasOwnProperty("lufs")) + if (typeof message.lufs !== "number") + return "lufs: number expected"; + if (message.highBoost != null && message.hasOwnProperty("highBoost")) + if (typeof message.highBoost !== "boolean") + return "highBoost: boolean expected"; + if (message.lowBoost != null && message.hasOwnProperty("lowBoost")) + if (typeof message.lowBoost !== "boolean") + return "lowBoost: boolean expected"; + return null; + }; + + /** + * Creates an Audio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Audio} Audio + */ + Audio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio) + return object; + var message = new $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Audio(); + if (object.lufs != null) + message.lufs = Number(object.lufs); + if (object.highBoost != null) + message.highBoost = Boolean(object.highBoost); + if (object.lowBoost != null) + message.lowBoost = Boolean(object.lowBoost); + return message; + }; + + /** + * Creates a plain object from an Audio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.Audio} message Audio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Audio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lufs = 0; + object.highBoost = false; + object.lowBoost = false; + } + if (message.lufs != null && message.hasOwnProperty("lufs")) + object.lufs = options.json && !isFinite(message.lufs) ? String(message.lufs) : message.lufs; + if (message.highBoost != null && message.hasOwnProperty("highBoost")) + object.highBoost = message.highBoost; + if (message.lowBoost != null && message.hasOwnProperty("lowBoost")) + object.lowBoost = message.lowBoost; + return object; + }; + + /** + * Converts this Audio to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @instance + * @returns {Object.} JSON object + */ + Audio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Audio + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Audio + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Audio.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"; + }; + + return Audio; + })(); + + PreprocessingConfig.Crop = (function() { + + /** + * Properties of a Crop. + * @memberof google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig + * @classdesc Represents a Crop. + * @implements ICrop + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.topPixels = 0; + + /** + * Crop bottomPixels. + * @member {number} bottomPixels + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.bottomPixels = 0; + + /** + * Crop leftPixels. + * @member {number} leftPixels + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.leftPixels = 0; + + /** + * Crop rightPixels. + * @member {number} rightPixels + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Crop + * @instance + */ + Crop.prototype.rightPixels = 0; + + /** + * Creates a new Crop instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.ICrop=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Crop.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Crop.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.Crop + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.Crop + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Crop} Crop + */ + Crop.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Crop) + return object; + var message = new $root.google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Crop + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.Crop"; + }; + + return Crop; + })(); + + PreprocessingConfig.Pad = (function() { + + /** + * Properties of a Pad. + * @memberof google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig + * @classdesc Represents a Pad. + * @implements IPad + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.topPixels = 0; + + /** + * Pad bottomPixels. + * @member {number} bottomPixels + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.bottomPixels = 0; + + /** + * Pad leftPixels. + * @member {number} leftPixels + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.leftPixels = 0; + + /** + * Pad rightPixels. + * @member {number} rightPixels + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Pad + * @instance + */ + Pad.prototype.rightPixels = 0; + + /** + * Creates a new Pad instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.transcoder.v1.PreprocessingConfig.IPad=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Pad.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Pad.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.Pad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.Pad + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.PreprocessingConfig.Pad} Pad + */ + Pad.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.PreprocessingConfig.Pad) + return object; + var message = new $root.google.cloud.video.transcoder.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.transcoder.v1.PreprocessingConfig.Pad + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.PreprocessingConfig.Pad"; + }; + + return Pad; + })(); + + return PreprocessingConfig; + })(); + + v1.VideoStream = (function() { + + /** + * Properties of a VideoStream. + * @memberof google.cloud.video.transcoder.v1 + * @interface IVideoStream + * @property {google.cloud.video.transcoder.v1.VideoStream.IH264CodecSettings|null} [h264] VideoStream h264 + * @property {google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings|null} [h265] VideoStream h265 + * @property {google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings|null} [vp9] VideoStream vp9 + */ + + /** + * Constructs a new VideoStream. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a VideoStream. + * @implements IVideoStream + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.VideoStream.IH264CodecSettings|null|undefined} h264 + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @instance + */ + VideoStream.prototype.h264 = null; + + /** + * VideoStream h265. + * @member {google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings|null|undefined} h265 + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @instance + */ + VideoStream.prototype.h265 = null; + + /** + * VideoStream vp9. + * @member {google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings|null|undefined} vp9 + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @instance + */ + VideoStream.prototype.vp9 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VideoStream codecSettings. + * @member {"h264"|"h265"|"vp9"|undefined} codecSettings + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @instance + */ + Object.defineProperty(VideoStream.prototype, "codecSettings", { + get: $util.oneOfGetter($oneOfFields = ["h264", "h265", "vp9"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VideoStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @static + * @param {google.cloud.video.transcoder.v1.IVideoStream=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.VideoStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings.encode(message.h264, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.h265 != null && Object.hasOwnProperty.call(message, "h265")) + $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.encode(message.h265, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.vp9 != null && Object.hasOwnProperty.call(message, "vp9")) + $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.encode(message.vp9, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.VideoStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.h264 = $root.google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.h265 = $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.decode(reader, reader.uint32()); + break; + } + case 3: { + message.vp9 = $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.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.transcoder.v1.VideoStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings.verify(message.h264); + if (error) + return "h264." + error; + } + } + if (message.h265 != null && message.hasOwnProperty("h265")) { + if (properties.codecSettings === 1) + return "codecSettings: multiple values"; + properties.codecSettings = 1; + { + var error = $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.verify(message.h265); + if (error) + return "h265." + error; + } + } + if (message.vp9 != null && message.hasOwnProperty("vp9")) { + if (properties.codecSettings === 1) + return "codecSettings: multiple values"; + properties.codecSettings = 1; + { + var error = $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.verify(message.vp9); + if (error) + return "vp9." + 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.transcoder.v1.VideoStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.VideoStream} VideoStream + */ + VideoStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.VideoStream) + return object; + var message = new $root.google.cloud.video.transcoder.v1.VideoStream(); + if (object.h264 != null) { + if (typeof object.h264 !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.VideoStream.h264: object expected"); + message.h264 = $root.google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.fromObject(object.h264); + } + if (object.h265 != null) { + if (typeof object.h265 !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.VideoStream.h265: object expected"); + message.h265 = $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.fromObject(object.h265); + } + if (object.vp9 != null) { + if (typeof object.vp9 !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.VideoStream.vp9: object expected"); + message.vp9 = $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.fromObject(object.vp9); + } + return message; + }; + + /** + * Creates a plain object from a VideoStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings.toObject(message.h264, options); + if (options.oneofs) + object.codecSettings = "h264"; + } + if (message.h265 != null && message.hasOwnProperty("h265")) { + object.h265 = $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.toObject(message.h265, options); + if (options.oneofs) + object.codecSettings = "h265"; + } + if (message.vp9 != null && message.hasOwnProperty("vp9")) { + object.vp9 = $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.toObject(message.vp9, options); + if (options.oneofs) + object.codecSettings = "vp9"; + } + return object; + }; + + /** + * Converts this VideoStream to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.VideoStream"; + }; + + VideoStream.H264CodecSettings = (function() { + + /** + * Properties of a H264CodecSettings. + * @memberof google.cloud.video.transcoder.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 {string|null} [pixelFormat] H264CodecSettings pixelFormat + * @property {string|null} [rateControlMode] H264CodecSettings rateControlMode + * @property {number|null} [crfLevel] H264CodecSettings crfLevel + * @property {boolean|null} [allowOpenGop] H264CodecSettings allowOpenGop + * @property {number|null} [gopFrameCount] H264CodecSettings gopFrameCount + * @property {google.protobuf.IDuration|null} [gopDuration] H264CodecSettings gopDuration + * @property {boolean|null} [enableTwoPass] H264CodecSettings enableTwoPass + * @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 + * @property {string|null} [preset] H264CodecSettings preset + */ + + /** + * Constructs a new H264CodecSettings. + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @classdesc Represents a H264CodecSettings. + * @implements IH264CodecSettings + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.widthPixels = 0; + + /** + * H264CodecSettings heightPixels. + * @member {number} heightPixels + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.heightPixels = 0; + + /** + * H264CodecSettings frameRate. + * @member {number} frameRate + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.frameRate = 0; + + /** + * H264CodecSettings bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.bitrateBps = 0; + + /** + * H264CodecSettings pixelFormat. + * @member {string} pixelFormat + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.pixelFormat = ""; + + /** + * H264CodecSettings rateControlMode. + * @member {string} rateControlMode + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.rateControlMode = ""; + + /** + * H264CodecSettings crfLevel. + * @member {number} crfLevel + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.crfLevel = 0; + + /** + * H264CodecSettings allowOpenGop. + * @member {boolean} allowOpenGop + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.allowOpenGop = false; + + /** + * H264CodecSettings gopFrameCount. + * @member {number|null|undefined} gopFrameCount + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.gopFrameCount = null; + + /** + * H264CodecSettings gopDuration. + * @member {google.protobuf.IDuration|null|undefined} gopDuration + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.gopDuration = null; + + /** + * H264CodecSettings enableTwoPass. + * @member {boolean} enableTwoPass + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.enableTwoPass = false; + + /** + * H264CodecSettings vbvSizeBits. + * @member {number} vbvSizeBits + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.vbvSizeBits = 0; + + /** + * H264CodecSettings vbvFullnessBits. + * @member {number} vbvFullnessBits + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.vbvFullnessBits = 0; + + /** + * H264CodecSettings entropyCoder. + * @member {string} entropyCoder + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.entropyCoder = ""; + + /** + * H264CodecSettings bPyramid. + * @member {boolean} bPyramid + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.bPyramid = false; + + /** + * H264CodecSettings bFrameCount. + * @member {number} bFrameCount + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.bFrameCount = 0; + + /** + * H264CodecSettings aqStrength. + * @member {number} aqStrength + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.aqStrength = 0; + + /** + * H264CodecSettings profile. + * @member {string} profile + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.profile = ""; + + /** + * H264CodecSettings tune. + * @member {string} tune + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.tune = ""; + + /** + * H264CodecSettings preset. + * @member {string} preset + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @instance + */ + H264CodecSettings.prototype.preset = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * H264CodecSettings gopMode. + * @member {"gopFrameCount"|"gopDuration"|undefined} gopMode + * @memberof google.cloud.video.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IH264CodecSettings=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.transcoder.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.pixelFormat != null && Object.hasOwnProperty.call(message, "pixelFormat")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pixelFormat); + if (message.rateControlMode != null && Object.hasOwnProperty.call(message, "rateControlMode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.rateControlMode); + if (message.crfLevel != null && Object.hasOwnProperty.call(message, "crfLevel")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.crfLevel); + if (message.allowOpenGop != null && Object.hasOwnProperty.call(message, "allowOpenGop")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allowOpenGop); + if (message.gopFrameCount != null && Object.hasOwnProperty.call(message, "gopFrameCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.gopFrameCount); + if (message.gopDuration != null && Object.hasOwnProperty.call(message, "gopDuration")) + $root.google.protobuf.Duration.encode(message.gopDuration, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.enableTwoPass != null && Object.hasOwnProperty.call(message, "enableTwoPass")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableTwoPass); + if (message.vbvSizeBits != null && Object.hasOwnProperty.call(message, "vbvSizeBits")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.vbvSizeBits); + if (message.vbvFullnessBits != null && Object.hasOwnProperty.call(message, "vbvFullnessBits")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.vbvFullnessBits); + if (message.entropyCoder != null && Object.hasOwnProperty.call(message, "entropyCoder")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.entropyCoder); + if (message.bPyramid != null && Object.hasOwnProperty.call(message, "bPyramid")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.bPyramid); + if (message.bFrameCount != null && Object.hasOwnProperty.call(message, "bFrameCount")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.bFrameCount); + if (message.aqStrength != null && Object.hasOwnProperty.call(message, "aqStrength")) + writer.uint32(/* id 17, wireType 1 =*/137).double(message.aqStrength); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.profile); + if (message.tune != null && Object.hasOwnProperty.call(message, "tune")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.tune); + if (message.preset != null && Object.hasOwnProperty.call(message, "preset")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.preset); + return writer; + }; + + /** + * Encodes the specified H264CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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 5: { + message.pixelFormat = reader.string(); + break; + } + case 6: { + message.rateControlMode = reader.string(); + break; + } + case 7: { + message.crfLevel = reader.int32(); + break; + } + case 8: { + message.allowOpenGop = reader.bool(); + break; + } + case 9: { + message.gopFrameCount = reader.int32(); + break; + } + case 10: { + message.gopDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 11: { + message.enableTwoPass = reader.bool(); + break; + } + case 12: { + message.vbvSizeBits = reader.int32(); + break; + } + case 13: { + message.vbvFullnessBits = reader.int32(); + break; + } + case 14: { + message.entropyCoder = reader.string(); + break; + } + case 15: { + message.bPyramid = reader.bool(); + break; + } + case 16: { + message.bFrameCount = reader.int32(); + break; + } + case 17: { + message.aqStrength = reader.double(); + break; + } + case 18: { + message.profile = reader.string(); + break; + } + case 19: { + message.tune = reader.string(); + break; + } + case 20: { + message.preset = 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.transcoder.v1.VideoStream.H264CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.pixelFormat != null && message.hasOwnProperty("pixelFormat")) + if (!$util.isString(message.pixelFormat)) + return "pixelFormat: string expected"; + if (message.rateControlMode != null && message.hasOwnProperty("rateControlMode")) + if (!$util.isString(message.rateControlMode)) + return "rateControlMode: string expected"; + if (message.crfLevel != null && message.hasOwnProperty("crfLevel")) + if (!$util.isInteger(message.crfLevel)) + return "crfLevel: 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.enableTwoPass != null && message.hasOwnProperty("enableTwoPass")) + if (typeof message.enableTwoPass !== "boolean") + return "enableTwoPass: boolean expected"; + 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"; + if (message.preset != null && message.hasOwnProperty("preset")) + if (!$util.isString(message.preset)) + return "preset: 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.transcoder.v1.VideoStream.H264CodecSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings} H264CodecSettings + */ + H264CodecSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings) + return object; + var message = new $root.google.cloud.video.transcoder.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.pixelFormat != null) + message.pixelFormat = String(object.pixelFormat); + if (object.rateControlMode != null) + message.rateControlMode = String(object.rateControlMode); + if (object.crfLevel != null) + message.crfLevel = object.crfLevel | 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.transcoder.v1.VideoStream.H264CodecSettings.gopDuration: object expected"); + message.gopDuration = $root.google.protobuf.Duration.fromObject(object.gopDuration); + } + if (object.enableTwoPass != null) + message.enableTwoPass = Boolean(object.enableTwoPass); + 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); + if (object.preset != null) + message.preset = String(object.preset); + return message; + }; + + /** + * Creates a plain object from a H264CodecSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings + * @static + * @param {google.cloud.video.transcoder.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.pixelFormat = ""; + object.rateControlMode = ""; + object.crfLevel = 0; + object.allowOpenGop = false; + object.enableTwoPass = false; + object.vbvSizeBits = 0; + object.vbvFullnessBits = 0; + object.entropyCoder = ""; + object.bPyramid = false; + object.bFrameCount = 0; + object.aqStrength = 0; + object.profile = ""; + object.tune = ""; + object.preset = ""; + } + 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.pixelFormat != null && message.hasOwnProperty("pixelFormat")) + object.pixelFormat = message.pixelFormat; + if (message.rateControlMode != null && message.hasOwnProperty("rateControlMode")) + object.rateControlMode = message.rateControlMode; + if (message.crfLevel != null && message.hasOwnProperty("crfLevel")) + object.crfLevel = message.crfLevel; + 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.enableTwoPass != null && message.hasOwnProperty("enableTwoPass")) + object.enableTwoPass = message.enableTwoPass; + 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; + if (message.preset != null && message.hasOwnProperty("preset")) + object.preset = message.preset; + return object; + }; + + /** + * Converts this H264CodecSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.VideoStream.H264CodecSettings"; + }; + + return H264CodecSettings; + })(); + + VideoStream.H265CodecSettings = (function() { + + /** + * Properties of a H265CodecSettings. + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @interface IH265CodecSettings + * @property {number|null} [widthPixels] H265CodecSettings widthPixels + * @property {number|null} [heightPixels] H265CodecSettings heightPixels + * @property {number|null} [frameRate] H265CodecSettings frameRate + * @property {number|null} [bitrateBps] H265CodecSettings bitrateBps + * @property {string|null} [pixelFormat] H265CodecSettings pixelFormat + * @property {string|null} [rateControlMode] H265CodecSettings rateControlMode + * @property {number|null} [crfLevel] H265CodecSettings crfLevel + * @property {boolean|null} [allowOpenGop] H265CodecSettings allowOpenGop + * @property {number|null} [gopFrameCount] H265CodecSettings gopFrameCount + * @property {google.protobuf.IDuration|null} [gopDuration] H265CodecSettings gopDuration + * @property {boolean|null} [enableTwoPass] H265CodecSettings enableTwoPass + * @property {number|null} [vbvSizeBits] H265CodecSettings vbvSizeBits + * @property {number|null} [vbvFullnessBits] H265CodecSettings vbvFullnessBits + * @property {boolean|null} [bPyramid] H265CodecSettings bPyramid + * @property {number|null} [bFrameCount] H265CodecSettings bFrameCount + * @property {number|null} [aqStrength] H265CodecSettings aqStrength + * @property {string|null} [profile] H265CodecSettings profile + * @property {string|null} [tune] H265CodecSettings tune + * @property {string|null} [preset] H265CodecSettings preset + */ + + /** + * Constructs a new H265CodecSettings. + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @classdesc Represents a H265CodecSettings. + * @implements IH265CodecSettings + * @constructor + * @param {google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings=} [properties] Properties to set + */ + function H265CodecSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * H265CodecSettings widthPixels. + * @member {number} widthPixels + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.widthPixels = 0; + + /** + * H265CodecSettings heightPixels. + * @member {number} heightPixels + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.heightPixels = 0; + + /** + * H265CodecSettings frameRate. + * @member {number} frameRate + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.frameRate = 0; + + /** + * H265CodecSettings bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.bitrateBps = 0; + + /** + * H265CodecSettings pixelFormat. + * @member {string} pixelFormat + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.pixelFormat = ""; + + /** + * H265CodecSettings rateControlMode. + * @member {string} rateControlMode + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.rateControlMode = ""; + + /** + * H265CodecSettings crfLevel. + * @member {number} crfLevel + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.crfLevel = 0; + + /** + * H265CodecSettings allowOpenGop. + * @member {boolean} allowOpenGop + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.allowOpenGop = false; + + /** + * H265CodecSettings gopFrameCount. + * @member {number|null|undefined} gopFrameCount + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.gopFrameCount = null; + + /** + * H265CodecSettings gopDuration. + * @member {google.protobuf.IDuration|null|undefined} gopDuration + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.gopDuration = null; + + /** + * H265CodecSettings enableTwoPass. + * @member {boolean} enableTwoPass + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.enableTwoPass = false; + + /** + * H265CodecSettings vbvSizeBits. + * @member {number} vbvSizeBits + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.vbvSizeBits = 0; + + /** + * H265CodecSettings vbvFullnessBits. + * @member {number} vbvFullnessBits + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.vbvFullnessBits = 0; + + /** + * H265CodecSettings bPyramid. + * @member {boolean} bPyramid + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.bPyramid = false; + + /** + * H265CodecSettings bFrameCount. + * @member {number} bFrameCount + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.bFrameCount = 0; + + /** + * H265CodecSettings aqStrength. + * @member {number} aqStrength + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.aqStrength = 0; + + /** + * H265CodecSettings profile. + * @member {string} profile + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.profile = ""; + + /** + * H265CodecSettings tune. + * @member {string} tune + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.tune = ""; + + /** + * H265CodecSettings preset. + * @member {string} preset + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + H265CodecSettings.prototype.preset = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * H265CodecSettings gopMode. + * @member {"gopFrameCount"|"gopDuration"|undefined} gopMode + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + */ + Object.defineProperty(H265CodecSettings.prototype, "gopMode", { + get: $util.oneOfGetter($oneOfFields = ["gopFrameCount", "gopDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new H265CodecSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings} H265CodecSettings instance + */ + H265CodecSettings.create = function create(properties) { + return new H265CodecSettings(properties); + }; + + /** + * Encodes the specified H265CodecSettings message. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings} message H265CodecSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + H265CodecSettings.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.pixelFormat != null && Object.hasOwnProperty.call(message, "pixelFormat")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pixelFormat); + if (message.rateControlMode != null && Object.hasOwnProperty.call(message, "rateControlMode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.rateControlMode); + if (message.crfLevel != null && Object.hasOwnProperty.call(message, "crfLevel")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.crfLevel); + if (message.allowOpenGop != null && Object.hasOwnProperty.call(message, "allowOpenGop")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.allowOpenGop); + if (message.gopFrameCount != null && Object.hasOwnProperty.call(message, "gopFrameCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.gopFrameCount); + if (message.gopDuration != null && Object.hasOwnProperty.call(message, "gopDuration")) + $root.google.protobuf.Duration.encode(message.gopDuration, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.enableTwoPass != null && Object.hasOwnProperty.call(message, "enableTwoPass")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableTwoPass); + if (message.vbvSizeBits != null && Object.hasOwnProperty.call(message, "vbvSizeBits")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.vbvSizeBits); + if (message.vbvFullnessBits != null && Object.hasOwnProperty.call(message, "vbvFullnessBits")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.vbvFullnessBits); + if (message.bPyramid != null && Object.hasOwnProperty.call(message, "bPyramid")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.bPyramid); + if (message.bFrameCount != null && Object.hasOwnProperty.call(message, "bFrameCount")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.bFrameCount); + if (message.aqStrength != null && Object.hasOwnProperty.call(message, "aqStrength")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.aqStrength); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.profile); + if (message.tune != null && Object.hasOwnProperty.call(message, "tune")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.tune); + if (message.preset != null && Object.hasOwnProperty.call(message, "preset")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.preset); + return writer; + }; + + /** + * Encodes the specified H265CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IH265CodecSettings} message H265CodecSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + H265CodecSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a H265CodecSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings} H265CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + H265CodecSettings.decode = function 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.transcoder.v1.VideoStream.H265CodecSettings(); + 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 5: { + message.pixelFormat = reader.string(); + break; + } + case 6: { + message.rateControlMode = reader.string(); + break; + } + case 7: { + message.crfLevel = reader.int32(); + break; + } + case 8: { + message.allowOpenGop = reader.bool(); + break; + } + case 9: { + message.gopFrameCount = reader.int32(); + break; + } + case 10: { + message.gopDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 11: { + message.enableTwoPass = reader.bool(); + break; + } + case 12: { + message.vbvSizeBits = reader.int32(); + break; + } + case 13: { + message.vbvFullnessBits = reader.int32(); + break; + } + case 14: { + message.bPyramid = reader.bool(); + break; + } + case 15: { + message.bFrameCount = reader.int32(); + break; + } + case 16: { + message.aqStrength = reader.double(); + break; + } + case 17: { + message.profile = reader.string(); + break; + } + case 18: { + message.tune = reader.string(); + break; + } + case 19: { + message.preset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a H265CodecSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings} H265CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + H265CodecSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a H265CodecSettings message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + H265CodecSettings.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.pixelFormat != null && message.hasOwnProperty("pixelFormat")) + if (!$util.isString(message.pixelFormat)) + return "pixelFormat: string expected"; + if (message.rateControlMode != null && message.hasOwnProperty("rateControlMode")) + if (!$util.isString(message.rateControlMode)) + return "rateControlMode: string expected"; + if (message.crfLevel != null && message.hasOwnProperty("crfLevel")) + if (!$util.isInteger(message.crfLevel)) + return "crfLevel: 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.enableTwoPass != null && message.hasOwnProperty("enableTwoPass")) + if (typeof message.enableTwoPass !== "boolean") + return "enableTwoPass: boolean expected"; + 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.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"; + if (message.preset != null && message.hasOwnProperty("preset")) + if (!$util.isString(message.preset)) + return "preset: string expected"; + return null; + }; + + /** + * Creates a H265CodecSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings} H265CodecSettings + */ + H265CodecSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings) + return object; + var message = new $root.google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings(); + 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.pixelFormat != null) + message.pixelFormat = String(object.pixelFormat); + if (object.rateControlMode != null) + message.rateControlMode = String(object.rateControlMode); + if (object.crfLevel != null) + message.crfLevel = object.crfLevel | 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.transcoder.v1.VideoStream.H265CodecSettings.gopDuration: object expected"); + message.gopDuration = $root.google.protobuf.Duration.fromObject(object.gopDuration); + } + if (object.enableTwoPass != null) + message.enableTwoPass = Boolean(object.enableTwoPass); + if (object.vbvSizeBits != null) + message.vbvSizeBits = object.vbvSizeBits | 0; + if (object.vbvFullnessBits != null) + message.vbvFullnessBits = object.vbvFullnessBits | 0; + 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); + if (object.preset != null) + message.preset = String(object.preset); + return message; + }; + + /** + * Creates a plain object from a H265CodecSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings} message H265CodecSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + H265CodecSettings.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.pixelFormat = ""; + object.rateControlMode = ""; + object.crfLevel = 0; + object.allowOpenGop = false; + object.enableTwoPass = false; + object.vbvSizeBits = 0; + object.vbvFullnessBits = 0; + object.bPyramid = false; + object.bFrameCount = 0; + object.aqStrength = 0; + object.profile = ""; + object.tune = ""; + object.preset = ""; + } + 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.pixelFormat != null && message.hasOwnProperty("pixelFormat")) + object.pixelFormat = message.pixelFormat; + if (message.rateControlMode != null && message.hasOwnProperty("rateControlMode")) + object.rateControlMode = message.rateControlMode; + if (message.crfLevel != null && message.hasOwnProperty("crfLevel")) + object.crfLevel = message.crfLevel; + 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.enableTwoPass != null && message.hasOwnProperty("enableTwoPass")) + object.enableTwoPass = message.enableTwoPass; + if (message.vbvSizeBits != null && message.hasOwnProperty("vbvSizeBits")) + object.vbvSizeBits = message.vbvSizeBits; + if (message.vbvFullnessBits != null && message.hasOwnProperty("vbvFullnessBits")) + object.vbvFullnessBits = message.vbvFullnessBits; + 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; + if (message.preset != null && message.hasOwnProperty("preset")) + object.preset = message.preset; + return object; + }; + + /** + * Converts this H265CodecSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @instance + * @returns {Object.} JSON object + */ + H265CodecSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for H265CodecSettings + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + H265CodecSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"; + }; + + return H265CodecSettings; + })(); + + VideoStream.Vp9CodecSettings = (function() { + + /** + * Properties of a Vp9CodecSettings. + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @interface IVp9CodecSettings + * @property {number|null} [widthPixels] Vp9CodecSettings widthPixels + * @property {number|null} [heightPixels] Vp9CodecSettings heightPixels + * @property {number|null} [frameRate] Vp9CodecSettings frameRate + * @property {number|null} [bitrateBps] Vp9CodecSettings bitrateBps + * @property {string|null} [pixelFormat] Vp9CodecSettings pixelFormat + * @property {string|null} [rateControlMode] Vp9CodecSettings rateControlMode + * @property {number|null} [crfLevel] Vp9CodecSettings crfLevel + * @property {number|null} [gopFrameCount] Vp9CodecSettings gopFrameCount + * @property {google.protobuf.IDuration|null} [gopDuration] Vp9CodecSettings gopDuration + * @property {string|null} [profile] Vp9CodecSettings profile + */ + + /** + * Constructs a new Vp9CodecSettings. + * @memberof google.cloud.video.transcoder.v1.VideoStream + * @classdesc Represents a Vp9CodecSettings. + * @implements IVp9CodecSettings + * @constructor + * @param {google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings=} [properties] Properties to set + */ + function Vp9CodecSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vp9CodecSettings widthPixels. + * @member {number} widthPixels + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.widthPixels = 0; + + /** + * Vp9CodecSettings heightPixels. + * @member {number} heightPixels + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.heightPixels = 0; + + /** + * Vp9CodecSettings frameRate. + * @member {number} frameRate + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.frameRate = 0; + + /** + * Vp9CodecSettings bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.bitrateBps = 0; + + /** + * Vp9CodecSettings pixelFormat. + * @member {string} pixelFormat + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.pixelFormat = ""; + + /** + * Vp9CodecSettings rateControlMode. + * @member {string} rateControlMode + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.rateControlMode = ""; + + /** + * Vp9CodecSettings crfLevel. + * @member {number} crfLevel + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.crfLevel = 0; + + /** + * Vp9CodecSettings gopFrameCount. + * @member {number|null|undefined} gopFrameCount + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.gopFrameCount = null; + + /** + * Vp9CodecSettings gopDuration. + * @member {google.protobuf.IDuration|null|undefined} gopDuration + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.gopDuration = null; + + /** + * Vp9CodecSettings profile. + * @member {string} profile + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Vp9CodecSettings.prototype.profile = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Vp9CodecSettings gopMode. + * @member {"gopFrameCount"|"gopDuration"|undefined} gopMode + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + */ + Object.defineProperty(Vp9CodecSettings.prototype, "gopMode", { + get: $util.oneOfGetter($oneOfFields = ["gopFrameCount", "gopDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Vp9CodecSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings} Vp9CodecSettings instance + */ + Vp9CodecSettings.create = function create(properties) { + return new Vp9CodecSettings(properties); + }; + + /** + * Encodes the specified Vp9CodecSettings message. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings} message Vp9CodecSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vp9CodecSettings.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.pixelFormat != null && Object.hasOwnProperty.call(message, "pixelFormat")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pixelFormat); + if (message.rateControlMode != null && Object.hasOwnProperty.call(message, "rateControlMode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.rateControlMode); + if (message.crfLevel != null && Object.hasOwnProperty.call(message, "crfLevel")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.crfLevel); + if (message.gopFrameCount != null && Object.hasOwnProperty.call(message, "gopFrameCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.gopFrameCount); + if (message.gopDuration != null && Object.hasOwnProperty.call(message, "gopDuration")) + $root.google.protobuf.Duration.encode(message.gopDuration, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.profile); + return writer; + }; + + /** + * Encodes the specified Vp9CodecSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.IVp9CodecSettings} message Vp9CodecSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vp9CodecSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vp9CodecSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings} Vp9CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vp9CodecSettings.decode = function 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.transcoder.v1.VideoStream.Vp9CodecSettings(); + 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 5: { + message.pixelFormat = reader.string(); + break; + } + case 6: { + message.rateControlMode = reader.string(); + break; + } + case 7: { + message.crfLevel = reader.int32(); + break; + } + case 8: { + message.gopFrameCount = reader.int32(); + break; + } + case 9: { + message.gopDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 10: { + message.profile = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vp9CodecSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings} Vp9CodecSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vp9CodecSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vp9CodecSettings message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vp9CodecSettings.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.pixelFormat != null && message.hasOwnProperty("pixelFormat")) + if (!$util.isString(message.pixelFormat)) + return "pixelFormat: string expected"; + if (message.rateControlMode != null && message.hasOwnProperty("rateControlMode")) + if (!$util.isString(message.rateControlMode)) + return "rateControlMode: string expected"; + if (message.crfLevel != null && message.hasOwnProperty("crfLevel")) + if (!$util.isInteger(message.crfLevel)) + return "crfLevel: integer 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.profile != null && message.hasOwnProperty("profile")) + if (!$util.isString(message.profile)) + return "profile: string expected"; + return null; + }; + + /** + * Creates a Vp9CodecSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings} Vp9CodecSettings + */ + Vp9CodecSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings) + return object; + var message = new $root.google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings(); + 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.pixelFormat != null) + message.pixelFormat = String(object.pixelFormat); + if (object.rateControlMode != null) + message.rateControlMode = String(object.rateControlMode); + if (object.crfLevel != null) + message.crfLevel = object.crfLevel | 0; + if (object.gopFrameCount != null) + message.gopFrameCount = object.gopFrameCount | 0; + if (object.gopDuration != null) { + if (typeof object.gopDuration !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gopDuration: object expected"); + message.gopDuration = $root.google.protobuf.Duration.fromObject(object.gopDuration); + } + if (object.profile != null) + message.profile = String(object.profile); + return message; + }; + + /** + * Creates a plain object from a Vp9CodecSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings} message Vp9CodecSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vp9CodecSettings.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.pixelFormat = ""; + object.rateControlMode = ""; + object.crfLevel = 0; + object.profile = ""; + } + 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.pixelFormat != null && message.hasOwnProperty("pixelFormat")) + object.pixelFormat = message.pixelFormat; + if (message.rateControlMode != null && message.hasOwnProperty("rateControlMode")) + object.rateControlMode = message.rateControlMode; + if (message.crfLevel != null && message.hasOwnProperty("crfLevel")) + object.crfLevel = message.crfLevel; + 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.profile != null && message.hasOwnProperty("profile")) + object.profile = message.profile; + return object; + }; + + /** + * Converts this Vp9CodecSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @instance + * @returns {Object.} JSON object + */ + Vp9CodecSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vp9CodecSettings + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vp9CodecSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"; + }; + + return Vp9CodecSettings; + })(); + + return VideoStream; + })(); + + v1.AudioStream = (function() { + + /** + * Properties of an AudioStream. + * @memberof google.cloud.video.transcoder.v1 + * @interface IAudioStream + * @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.transcoder.v1 + * @classdesc Represents an AudioStream. + * @implements IAudioStream + * @constructor + * @param {google.cloud.video.transcoder.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 codec. + * @member {string} codec + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @instance + */ + AudioStream.prototype.codec = ""; + + /** + * AudioStream bitrateBps. + * @member {number} bitrateBps + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @instance + */ + AudioStream.prototype.bitrateBps = 0; + + /** + * AudioStream channelCount. + * @member {number} channelCount + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @instance + */ + AudioStream.prototype.channelCount = 0; + + /** + * AudioStream channelLayout. + * @member {Array.} channelLayout + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @instance + */ + AudioStream.prototype.channelLayout = $util.emptyArray; + + /** + * AudioStream mapping. + * @member {Array.} mapping + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @instance + */ + AudioStream.prototype.mapping = $util.emptyArray; + + /** + * AudioStream sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @instance + */ + AudioStream.prototype.sampleRateHertz = 0; + + /** + * Creates a new AudioStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @static + * @param {google.cloud.video.transcoder.v1.IAudioStream=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.AudioStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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); + return writer; + }; + + /** + * Encodes the specified AudioStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.AudioStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.AudioStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + 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.transcoder.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.transcoder.v1.AudioStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.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.transcoder.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.transcoder.v1.AudioStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.AudioStream} AudioStream + */ + AudioStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.AudioStream) + return object; + var message = new $root.google.cloud.video.transcoder.v1.AudioStream(); + 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.transcoder.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.transcoder.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.transcoder.v1.AudioStream.mapping: object expected"); + message.mapping[i] = $root.google.cloud.video.transcoder.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.transcoder.v1.AudioStream + * @static + * @param {google.cloud.video.transcoder.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; + } + 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.transcoder.v1.AudioStream.AudioMapping.toObject(message.mapping[j], options); + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + return object; + }; + + /** + * Converts this AudioStream to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.AudioStream"; + }; + + AudioStream.AudioMapping = (function() { + + /** + * Properties of an AudioMapping. + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @interface IAudioMapping + * @property {string|null} [atomKey] AudioMapping atomKey + * @property {string|null} [inputKey] AudioMapping inputKey + * @property {number|null} [inputTrack] AudioMapping inputTrack + * @property {number|null} [inputChannel] AudioMapping inputChannel + * @property {number|null} [outputChannel] AudioMapping outputChannel + * @property {number|null} [gainDb] AudioMapping gainDb + */ + + /** + * Constructs a new AudioMapping. + * @memberof google.cloud.video.transcoder.v1.AudioStream + * @classdesc Represents an AudioMapping. + * @implements IAudioMapping + * @constructor + * @param {google.cloud.video.transcoder.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 atomKey. + * @member {string} atomKey + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.atomKey = ""; + + /** + * AudioMapping inputKey. + * @member {string} inputKey + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.inputKey = ""; + + /** + * AudioMapping inputTrack. + * @member {number} inputTrack + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.inputTrack = 0; + + /** + * AudioMapping inputChannel. + * @member {number} inputChannel + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.inputChannel = 0; + + /** + * AudioMapping outputChannel. + * @member {number} outputChannel + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.outputChannel = 0; + + /** + * AudioMapping gainDb. + * @member {number} gainDb + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @instance + */ + AudioMapping.prototype.gainDb = 0; + + /** + * Creates a new AudioMapping instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.transcoder.v1.AudioStream.IAudioMapping=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.AudioStream.AudioMapping.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.transcoder.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.atomKey != null && Object.hasOwnProperty.call(message, "atomKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.atomKey); + if (message.inputKey != null && Object.hasOwnProperty.call(message, "inputKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputKey); + if (message.inputTrack != null && Object.hasOwnProperty.call(message, "inputTrack")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.inputTrack); + if (message.inputChannel != null && Object.hasOwnProperty.call(message, "inputChannel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.inputChannel); + if (message.outputChannel != null && Object.hasOwnProperty.call(message, "outputChannel")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.outputChannel); + if (message.gainDb != null && Object.hasOwnProperty.call(message, "gainDb")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.gainDb); + return writer; + }; + + /** + * Encodes the specified AudioMapping message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.AudioStream.AudioMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.AudioStream.AudioMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.atomKey = reader.string(); + break; + } + case 2: { + message.inputKey = reader.string(); + break; + } + case 3: { + message.inputTrack = reader.int32(); + break; + } + case 4: { + message.inputChannel = reader.int32(); + break; + } + case 5: { + message.outputChannel = reader.int32(); + break; + } + case 6: { + message.gainDb = reader.double(); + 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.transcoder.v1.AudioStream.AudioMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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.atomKey != null && message.hasOwnProperty("atomKey")) + if (!$util.isString(message.atomKey)) + return "atomKey: string 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"; + if (message.gainDb != null && message.hasOwnProperty("gainDb")) + if (typeof message.gainDb !== "number") + return "gainDb: number 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.transcoder.v1.AudioStream.AudioMapping + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.AudioStream.AudioMapping} AudioMapping + */ + AudioMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.AudioStream.AudioMapping) + return object; + var message = new $root.google.cloud.video.transcoder.v1.AudioStream.AudioMapping(); + if (object.atomKey != null) + message.atomKey = String(object.atomKey); + 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; + if (object.gainDb != null) + message.gainDb = Number(object.gainDb); + return message; + }; + + /** + * Creates a plain object from an AudioMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.AudioStream.AudioMapping + * @static + * @param {google.cloud.video.transcoder.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.atomKey = ""; + object.inputKey = ""; + object.inputTrack = 0; + object.inputChannel = 0; + object.outputChannel = 0; + object.gainDb = 0; + } + if (message.atomKey != null && message.hasOwnProperty("atomKey")) + object.atomKey = message.atomKey; + if (message.inputKey != null && message.hasOwnProperty("inputKey")) + object.inputKey = message.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.gainDb != null && message.hasOwnProperty("gainDb")) + object.gainDb = options.json && !isFinite(message.gainDb) ? String(message.gainDb) : message.gainDb; + return object; + }; + + /** + * Converts this AudioMapping to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.AudioStream.AudioMapping"; + }; + + return AudioMapping; + })(); + + return AudioStream; + })(); + + v1.TextStream = (function() { + + /** + * Properties of a TextStream. + * @memberof google.cloud.video.transcoder.v1 + * @interface ITextStream + * @property {string|null} [codec] TextStream codec + * @property {Array.|null} [mapping] TextStream mapping + */ + + /** + * Constructs a new TextStream. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a TextStream. + * @implements ITextStream + * @constructor + * @param {google.cloud.video.transcoder.v1.ITextStream=} [properties] Properties to set + */ + function TextStream(properties) { + 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]]; + } + + /** + * TextStream codec. + * @member {string} codec + * @memberof google.cloud.video.transcoder.v1.TextStream + * @instance + */ + TextStream.prototype.codec = ""; + + /** + * TextStream mapping. + * @member {Array.} mapping + * @memberof google.cloud.video.transcoder.v1.TextStream + * @instance + */ + TextStream.prototype.mapping = $util.emptyArray; + + /** + * Creates a new TextStream instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.TextStream + * @static + * @param {google.cloud.video.transcoder.v1.ITextStream=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.TextStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.TextStream + * @static + * @param {google.cloud.video.transcoder.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); + if (message.mapping != null && message.mapping.length) + for (var i = 0; i < message.mapping.length; ++i) + $root.google.cloud.video.transcoder.v1.TextStream.TextMapping.encode(message.mapping[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextStream message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.TextStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.TextStream + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.v1.TextStream(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.codec = reader.string(); + break; + } + case 3: { + if (!(message.mapping && message.mapping.length)) + message.mapping = []; + message.mapping.push($root.google.cloud.video.transcoder.v1.TextStream.TextMapping.decode(reader, reader.uint32())); + 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.transcoder.v1.TextStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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"; + 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.transcoder.v1.TextStream.TextMapping.verify(message.mapping[i]); + if (error) + return "mapping." + error; + } + } + return null; + }; + + /** + * Creates a TextStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.TextStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.TextStream} TextStream + */ + TextStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.TextStream) + return object; + var message = new $root.google.cloud.video.transcoder.v1.TextStream(); + if (object.codec != null) + message.codec = String(object.codec); + if (object.mapping) { + if (!Array.isArray(object.mapping)) + throw TypeError(".google.cloud.video.transcoder.v1.TextStream.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.transcoder.v1.TextStream.mapping: object expected"); + message.mapping[i] = $root.google.cloud.video.transcoder.v1.TextStream.TextMapping.fromObject(object.mapping[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.TextStream + * @static + * @param {google.cloud.video.transcoder.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.arrays || options.defaults) + object.mapping = []; + if (options.defaults) + object.codec = ""; + if (message.codec != null && message.hasOwnProperty("codec")) + object.codec = message.codec; + if (message.mapping && message.mapping.length) { + object.mapping = []; + for (var j = 0; j < message.mapping.length; ++j) + object.mapping[j] = $root.google.cloud.video.transcoder.v1.TextStream.TextMapping.toObject(message.mapping[j], options); + } + return object; + }; + + /** + * Converts this TextStream to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.TextStream"; + }; + + TextStream.TextMapping = (function() { + + /** + * Properties of a TextMapping. + * @memberof google.cloud.video.transcoder.v1.TextStream + * @interface ITextMapping + * @property {string|null} [atomKey] TextMapping atomKey + * @property {string|null} [inputKey] TextMapping inputKey + * @property {number|null} [inputTrack] TextMapping inputTrack + */ + + /** + * Constructs a new TextMapping. + * @memberof google.cloud.video.transcoder.v1.TextStream + * @classdesc Represents a TextMapping. + * @implements ITextMapping + * @constructor + * @param {google.cloud.video.transcoder.v1.TextStream.ITextMapping=} [properties] Properties to set + */ + function TextMapping(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextMapping atomKey. + * @member {string} atomKey + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @instance + */ + TextMapping.prototype.atomKey = ""; + + /** + * TextMapping inputKey. + * @member {string} inputKey + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @instance + */ + TextMapping.prototype.inputKey = ""; + + /** + * TextMapping inputTrack. + * @member {number} inputTrack + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @instance + */ + TextMapping.prototype.inputTrack = 0; + + /** + * Creates a new TextMapping instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {google.cloud.video.transcoder.v1.TextStream.ITextMapping=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.TextStream.TextMapping} TextMapping instance + */ + TextMapping.create = function create(properties) { + return new TextMapping(properties); + }; + + /** + * Encodes the specified TextMapping message. Does not implicitly {@link google.cloud.video.transcoder.v1.TextStream.TextMapping.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {google.cloud.video.transcoder.v1.TextStream.ITextMapping} message TextMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextMapping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.atomKey != null && Object.hasOwnProperty.call(message, "atomKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.atomKey); + if (message.inputKey != null && Object.hasOwnProperty.call(message, "inputKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputKey); + if (message.inputTrack != null && Object.hasOwnProperty.call(message, "inputTrack")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.inputTrack); + return writer; + }; + + /** + * Encodes the specified TextMapping message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.TextStream.TextMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {google.cloud.video.transcoder.v1.TextStream.ITextMapping} message TextMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextMapping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextMapping message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.TextStream.TextMapping} TextMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextMapping.decode = function 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.transcoder.v1.TextStream.TextMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.atomKey = reader.string(); + break; + } + case 2: { + message.inputKey = reader.string(); + break; + } + case 3: { + message.inputTrack = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextMapping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.TextStream.TextMapping} TextMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextMapping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextMapping message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextMapping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.atomKey != null && message.hasOwnProperty("atomKey")) + if (!$util.isString(message.atomKey)) + return "atomKey: string 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"; + return null; + }; + + /** + * Creates a TextMapping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.TextStream.TextMapping} TextMapping + */ + TextMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.TextStream.TextMapping) + return object; + var message = new $root.google.cloud.video.transcoder.v1.TextStream.TextMapping(); + if (object.atomKey != null) + message.atomKey = String(object.atomKey); + if (object.inputKey != null) + message.inputKey = String(object.inputKey); + if (object.inputTrack != null) + message.inputTrack = object.inputTrack | 0; + return message; + }; + + /** + * Creates a plain object from a TextMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {google.cloud.video.transcoder.v1.TextStream.TextMapping} message TextMapping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextMapping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.atomKey = ""; + object.inputKey = ""; + object.inputTrack = 0; + } + if (message.atomKey != null && message.hasOwnProperty("atomKey")) + object.atomKey = message.atomKey; + if (message.inputKey != null && message.hasOwnProperty("inputKey")) + object.inputKey = message.inputKey; + if (message.inputTrack != null && message.hasOwnProperty("inputTrack")) + object.inputTrack = message.inputTrack; + return object; + }; + + /** + * Converts this TextMapping to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @instance + * @returns {Object.} JSON object + */ + TextMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextMapping + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.TextStream.TextMapping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.TextStream.TextMapping"; + }; + + return TextMapping; + })(); + + return TextStream; + })(); + + v1.SegmentSettings = (function() { + + /** + * Properties of a SegmentSettings. + * @memberof google.cloud.video.transcoder.v1 + * @interface ISegmentSettings + * @property {google.protobuf.IDuration|null} [segmentDuration] SegmentSettings segmentDuration + * @property {boolean|null} [individualSegments] SegmentSettings individualSegments + */ + + /** + * Constructs a new SegmentSettings. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a SegmentSettings. + * @implements ISegmentSettings + * @constructor + * @param {google.cloud.video.transcoder.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.transcoder.v1.SegmentSettings + * @instance + */ + SegmentSettings.prototype.segmentDuration = null; + + /** + * SegmentSettings individualSegments. + * @member {boolean} individualSegments + * @memberof google.cloud.video.transcoder.v1.SegmentSettings + * @instance + */ + SegmentSettings.prototype.individualSegments = false; + + /** + * Creates a new SegmentSettings instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.SegmentSettings + * @static + * @param {google.cloud.video.transcoder.v1.ISegmentSettings=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.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.transcoder.v1.SegmentSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.SegmentSettings + * @static + * @param {google.cloud.video.transcoder.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(); + if (message.individualSegments != null && Object.hasOwnProperty.call(message, "individualSegments")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.individualSegments); + return writer; + }; + + /** + * Encodes the specified SegmentSettings message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.SegmentSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.SegmentSettings + * @static + * @param {google.cloud.video.transcoder.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.transcoder.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.transcoder.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.transcoder.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; + } + case 3: { + message.individualSegments = reader.bool(); + 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.transcoder.v1.SegmentSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.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.transcoder.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; + } + if (message.individualSegments != null && message.hasOwnProperty("individualSegments")) + if (typeof message.individualSegments !== "boolean") + return "individualSegments: boolean expected"; + return null; + }; + + /** + * Creates a SegmentSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.SegmentSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.SegmentSettings} SegmentSettings + */ + SegmentSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.SegmentSettings) + return object; + var message = new $root.google.cloud.video.transcoder.v1.SegmentSettings(); + if (object.segmentDuration != null) { + if (typeof object.segmentDuration !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.SegmentSettings.segmentDuration: object expected"); + message.segmentDuration = $root.google.protobuf.Duration.fromObject(object.segmentDuration); + } + if (object.individualSegments != null) + message.individualSegments = Boolean(object.individualSegments); + return message; + }; + + /** + * Creates a plain object from a SegmentSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.SegmentSettings + * @static + * @param {google.cloud.video.transcoder.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; + object.individualSegments = false; + } + if (message.segmentDuration != null && message.hasOwnProperty("segmentDuration")) + object.segmentDuration = $root.google.protobuf.Duration.toObject(message.segmentDuration, options); + if (message.individualSegments != null && message.hasOwnProperty("individualSegments")) + object.individualSegments = message.individualSegments; + return object; + }; + + /** + * Converts this SegmentSettings to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.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.transcoder.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.transcoder.v1.SegmentSettings"; + }; + + return SegmentSettings; + })(); + + v1.TranscoderService = (function() { + + /** + * Constructs a new TranscoderService service. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a TranscoderService + * @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 TranscoderService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TranscoderService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TranscoderService; + + /** + * Creates new TranscoderService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @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 {TranscoderService} RPC service. Useful where requests and/or responses are streamed. + */ + TranscoderService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|createJob}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.transcoder.v1.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.video.transcoder.v1.CreateJobRequest, $root.google.cloud.video.transcoder.v1.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|listJobs}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.transcoder.v1.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.video.transcoder.v1.ListJobsRequest, $root.google.cloud.video.transcoder.v1.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|getJob}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.transcoder.v1.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.video.transcoder.v1.GetJobRequest, $root.google.cloud.video.transcoder.v1.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|deleteJob}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.video.transcoder.v1.DeleteJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|createJobTemplate}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef CreateJobTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.transcoder.v1.JobTemplate} [response] JobTemplate + */ + + /** + * Calls CreateJobTemplate. + * @function createJobTemplate + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.ICreateJobTemplateRequest} request CreateJobTemplateRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.CreateJobTemplateCallback} callback Node-style callback called with the error, if any, and JobTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.createJobTemplate = function createJobTemplate(request, callback) { + return this.rpcCall(createJobTemplate, $root.google.cloud.video.transcoder.v1.CreateJobTemplateRequest, $root.google.cloud.video.transcoder.v1.JobTemplate, request, callback); + }, "name", { value: "CreateJobTemplate" }); + + /** + * Calls CreateJobTemplate. + * @function createJobTemplate + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.ICreateJobTemplateRequest} request CreateJobTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|listJobTemplates}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef ListJobTemplatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.transcoder.v1.ListJobTemplatesResponse} [response] ListJobTemplatesResponse + */ + + /** + * Calls ListJobTemplates. + * @function listJobTemplates + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesRequest} request ListJobTemplatesRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.ListJobTemplatesCallback} callback Node-style callback called with the error, if any, and ListJobTemplatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.listJobTemplates = function listJobTemplates(request, callback) { + return this.rpcCall(listJobTemplates, $root.google.cloud.video.transcoder.v1.ListJobTemplatesRequest, $root.google.cloud.video.transcoder.v1.ListJobTemplatesResponse, request, callback); + }, "name", { value: "ListJobTemplates" }); + + /** + * Calls ListJobTemplates. + * @function listJobTemplates + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesRequest} request ListJobTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|getJobTemplate}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef GetJobTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.video.transcoder.v1.JobTemplate} [response] JobTemplate + */ + + /** + * Calls GetJobTemplate. + * @function getJobTemplate + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IGetJobTemplateRequest} request GetJobTemplateRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.GetJobTemplateCallback} callback Node-style callback called with the error, if any, and JobTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.getJobTemplate = function getJobTemplate(request, callback) { + return this.rpcCall(getJobTemplate, $root.google.cloud.video.transcoder.v1.GetJobTemplateRequest, $root.google.cloud.video.transcoder.v1.JobTemplate, request, callback); + }, "name", { value: "GetJobTemplate" }); + + /** + * Calls GetJobTemplate. + * @function getJobTemplate + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IGetJobTemplateRequest} request GetJobTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.video.transcoder.v1.TranscoderService|deleteJobTemplate}. + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @typedef DeleteJobTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJobTemplate. + * @function deleteJobTemplate + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest} request DeleteJobTemplateRequest message or plain object + * @param {google.cloud.video.transcoder.v1.TranscoderService.DeleteJobTemplateCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TranscoderService.prototype.deleteJobTemplate = function deleteJobTemplate(request, callback) { + return this.rpcCall(deleteJobTemplate, $root.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJobTemplate" }); + + /** + * Calls DeleteJobTemplate. + * @function deleteJobTemplate + * @memberof google.cloud.video.transcoder.v1.TranscoderService + * @instance + * @param {google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest} request DeleteJobTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TranscoderService; + })(); + + v1.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {google.cloud.video.transcoder.v1.IJob|null} [job] CreateJobRequest job + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.video.transcoder.v1.IJob|null|undefined} job + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.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.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.video.transcoder.v1.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function 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.transcoder.v1.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.video.transcoder.v1.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.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.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.video.transcoder.v1.Job.verify(message.job); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.CreateJobRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.video.transcoder.v1.Job.fromObject(object.job); + } + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.job = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.video.transcoder.v1.Job.toObject(message.job, options); + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v1.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [orderBy] ListJobsRequest orderBy + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {google.cloud.video.transcoder.v1.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {google.cloud.video.transcoder.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.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 ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {google.cloud.video.transcoder.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function 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.transcoder.v1.ListJobsRequest(); + 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 ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.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 ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.ListJobsRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.ListJobsRequest(); + 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 ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {google.cloud.video.transcoder.v1.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.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 ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v1.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function 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.transcoder.v1.GetJobRequest(); + 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 GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.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 GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.GetJobRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.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 GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + * @property {boolean|null} [allowMissing] DeleteJobRequest allowMissing + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * DeleteJobRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.allowMissing = false; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function 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.transcoder.v1.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.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.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.DeleteJobRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {google.cloud.video.transcoder.v1.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v1.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.video.transcoder.v1 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobsResponse unreachable + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.video.transcoder.v1.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + 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]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {google.cloud.video.transcoder.v1.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {google.cloud.video.transcoder.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.video.transcoder.v1.Job.encode(message.jobs[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 ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {google.cloud.video.transcoder.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function 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.transcoder.v1.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.video.transcoder.v1.Job.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 ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.video.transcoder.v1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + 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 ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.ListJobsResponse) + return object; + var message = new $root.google.cloud.video.transcoder.v1.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.video.transcoder.v1.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.video.transcoder.v1.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.transcoder.v1.ListJobsResponse.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 ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {google.cloud.video.transcoder.v1.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.video.transcoder.v1.Job.toObject(message.jobs[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 ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1.CreateJobTemplateRequest = (function() { + + /** + * Properties of a CreateJobTemplateRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface ICreateJobTemplateRequest + * @property {string|null} [parent] CreateJobTemplateRequest parent + * @property {google.cloud.video.transcoder.v1.IJobTemplate|null} [jobTemplate] CreateJobTemplateRequest jobTemplate + * @property {string|null} [jobTemplateId] CreateJobTemplateRequest jobTemplateId + */ + + /** + * Constructs a new CreateJobTemplateRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a CreateJobTemplateRequest. + * @implements ICreateJobTemplateRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.ICreateJobTemplateRequest=} [properties] Properties to set + */ + function CreateJobTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobTemplateRequest parent. + * @member {string} parent + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @instance + */ + CreateJobTemplateRequest.prototype.parent = ""; + + /** + * CreateJobTemplateRequest jobTemplate. + * @member {google.cloud.video.transcoder.v1.IJobTemplate|null|undefined} jobTemplate + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @instance + */ + CreateJobTemplateRequest.prototype.jobTemplate = null; + + /** + * CreateJobTemplateRequest jobTemplateId. + * @member {string} jobTemplateId + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @instance + */ + CreateJobTemplateRequest.prototype.jobTemplateId = ""; + + /** + * Creates a new CreateJobTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.ICreateJobTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.CreateJobTemplateRequest} CreateJobTemplateRequest instance + */ + CreateJobTemplateRequest.create = function create(properties) { + return new CreateJobTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateJobTemplateRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.ICreateJobTemplateRequest} message CreateJobTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobTemplateRequest.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.jobTemplate != null && Object.hasOwnProperty.call(message, "jobTemplate")) + $root.google.cloud.video.transcoder.v1.JobTemplate.encode(message.jobTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jobTemplateId != null && Object.hasOwnProperty.call(message, "jobTemplateId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobTemplateId); + return writer; + }; + + /** + * Encodes the specified CreateJobTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.CreateJobTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.ICreateJobTemplateRequest} message CreateJobTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.CreateJobTemplateRequest} CreateJobTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobTemplateRequest.decode = function 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.transcoder.v1.CreateJobTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.jobTemplate = $root.google.cloud.video.transcoder.v1.JobTemplate.decode(reader, reader.uint32()); + break; + } + case 3: { + message.jobTemplateId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.CreateJobTemplateRequest} CreateJobTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobTemplateRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobTemplateRequest.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.jobTemplate != null && message.hasOwnProperty("jobTemplate")) { + var error = $root.google.cloud.video.transcoder.v1.JobTemplate.verify(message.jobTemplate); + if (error) + return "jobTemplate." + error; + } + if (message.jobTemplateId != null && message.hasOwnProperty("jobTemplateId")) + if (!$util.isString(message.jobTemplateId)) + return "jobTemplateId: string expected"; + return null; + }; + + /** + * Creates a CreateJobTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.CreateJobTemplateRequest} CreateJobTemplateRequest + */ + CreateJobTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.CreateJobTemplateRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.CreateJobTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobTemplate != null) { + if (typeof object.jobTemplate !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.CreateJobTemplateRequest.jobTemplate: object expected"); + message.jobTemplate = $root.google.cloud.video.transcoder.v1.JobTemplate.fromObject(object.jobTemplate); + } + if (object.jobTemplateId != null) + message.jobTemplateId = String(object.jobTemplateId); + return message; + }; + + /** + * Creates a plain object from a CreateJobTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.CreateJobTemplateRequest} message CreateJobTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobTemplate = null; + object.jobTemplateId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobTemplate != null && message.hasOwnProperty("jobTemplate")) + object.jobTemplate = $root.google.cloud.video.transcoder.v1.JobTemplate.toObject(message.jobTemplate, options); + if (message.jobTemplateId != null && message.hasOwnProperty("jobTemplateId")) + object.jobTemplateId = message.jobTemplateId; + return object; + }; + + /** + * Converts this CreateJobTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.CreateJobTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"; + }; + + return CreateJobTemplateRequest; + })(); + + v1.ListJobTemplatesRequest = (function() { + + /** + * Properties of a ListJobTemplatesRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IListJobTemplatesRequest + * @property {string|null} [parent] ListJobTemplatesRequest parent + * @property {number|null} [pageSize] ListJobTemplatesRequest pageSize + * @property {string|null} [pageToken] ListJobTemplatesRequest pageToken + * @property {string|null} [filter] ListJobTemplatesRequest filter + * @property {string|null} [orderBy] ListJobTemplatesRequest orderBy + */ + + /** + * Constructs a new ListJobTemplatesRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a ListJobTemplatesRequest. + * @implements IListJobTemplatesRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesRequest=} [properties] Properties to set + */ + function ListJobTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobTemplatesRequest parent. + * @member {string} parent + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @instance + */ + ListJobTemplatesRequest.prototype.parent = ""; + + /** + * ListJobTemplatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @instance + */ + ListJobTemplatesRequest.prototype.pageSize = 0; + + /** + * ListJobTemplatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @instance + */ + ListJobTemplatesRequest.prototype.pageToken = ""; + + /** + * ListJobTemplatesRequest filter. + * @member {string} filter + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @instance + */ + ListJobTemplatesRequest.prototype.filter = ""; + + /** + * ListJobTemplatesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @instance + */ + ListJobTemplatesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListJobTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesRequest} ListJobTemplatesRequest instance + */ + ListJobTemplatesRequest.create = function create(properties) { + return new ListJobTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListJobTemplatesRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesRequest} message ListJobTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTemplatesRequest.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 ListJobTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesRequest} message ListJobTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesRequest} ListJobTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTemplatesRequest.decode = function 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.transcoder.v1.ListJobTemplatesRequest(); + 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 ListJobTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesRequest} ListJobTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobTemplatesRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobTemplatesRequest.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 ListJobTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesRequest} ListJobTemplatesRequest + */ + ListJobTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.ListJobTemplatesRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.ListJobTemplatesRequest(); + 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 ListJobTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {google.cloud.video.transcoder.v1.ListJobTemplatesRequest} message ListJobTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobTemplatesRequest.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 ListJobTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobTemplatesRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"; + }; + + return ListJobTemplatesRequest; + })(); + + v1.GetJobTemplateRequest = (function() { + + /** + * Properties of a GetJobTemplateRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IGetJobTemplateRequest + * @property {string|null} [name] GetJobTemplateRequest name + */ + + /** + * Constructs a new GetJobTemplateRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a GetJobTemplateRequest. + * @implements IGetJobTemplateRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.IGetJobTemplateRequest=} [properties] Properties to set + */ + function GetJobTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobTemplateRequest name. + * @member {string} name + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @instance + */ + GetJobTemplateRequest.prototype.name = ""; + + /** + * Creates a new GetJobTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.IGetJobTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.GetJobTemplateRequest} GetJobTemplateRequest instance + */ + GetJobTemplateRequest.create = function create(properties) { + return new GetJobTemplateRequest(properties); + }; + + /** + * Encodes the specified GetJobTemplateRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.IGetJobTemplateRequest} message GetJobTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobTemplateRequest.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 GetJobTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.GetJobTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.IGetJobTemplateRequest} message GetJobTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.GetJobTemplateRequest} GetJobTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobTemplateRequest.decode = function 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.transcoder.v1.GetJobTemplateRequest(); + 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 GetJobTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.GetJobTemplateRequest} GetJobTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobTemplateRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobTemplateRequest.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 GetJobTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.GetJobTemplateRequest} GetJobTemplateRequest + */ + GetJobTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.GetJobTemplateRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.GetJobTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.GetJobTemplateRequest} message GetJobTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobTemplateRequest.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 GetJobTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.GetJobTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.GetJobTemplateRequest"; + }; + + return GetJobTemplateRequest; + })(); + + v1.DeleteJobTemplateRequest = (function() { + + /** + * Properties of a DeleteJobTemplateRequest. + * @memberof google.cloud.video.transcoder.v1 + * @interface IDeleteJobTemplateRequest + * @property {string|null} [name] DeleteJobTemplateRequest name + * @property {boolean|null} [allowMissing] DeleteJobTemplateRequest allowMissing + */ + + /** + * Constructs a new DeleteJobTemplateRequest. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a DeleteJobTemplateRequest. + * @implements IDeleteJobTemplateRequest + * @constructor + * @param {google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest=} [properties] Properties to set + */ + function DeleteJobTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobTemplateRequest name. + * @member {string} name + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @instance + */ + DeleteJobTemplateRequest.prototype.name = ""; + + /** + * DeleteJobTemplateRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @instance + */ + DeleteJobTemplateRequest.prototype.allowMissing = false; + + /** + * Creates a new DeleteJobTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.DeleteJobTemplateRequest} DeleteJobTemplateRequest instance + */ + DeleteJobTemplateRequest.create = function create(properties) { + return new DeleteJobTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteJobTemplateRequest message. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest} message DeleteJobTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobTemplateRequest.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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified DeleteJobTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.DeleteJobTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest} message DeleteJobTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.DeleteJobTemplateRequest} DeleteJobTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobTemplateRequest.decode = function 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.transcoder.v1.DeleteJobTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.DeleteJobTemplateRequest} DeleteJobTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobTemplateRequest message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobTemplateRequest.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.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates a DeleteJobTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.DeleteJobTemplateRequest} DeleteJobTemplateRequest + */ + DeleteJobTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest) + return object; + var message = new $root.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from a DeleteJobTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {google.cloud.video.transcoder.v1.DeleteJobTemplateRequest} message DeleteJobTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this DeleteJobTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.DeleteJobTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"; + }; + + return DeleteJobTemplateRequest; + })(); + + v1.ListJobTemplatesResponse = (function() { + + /** + * Properties of a ListJobTemplatesResponse. + * @memberof google.cloud.video.transcoder.v1 + * @interface IListJobTemplatesResponse + * @property {Array.|null} [jobTemplates] ListJobTemplatesResponse jobTemplates + * @property {string|null} [nextPageToken] ListJobTemplatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobTemplatesResponse unreachable + */ + + /** + * Constructs a new ListJobTemplatesResponse. + * @memberof google.cloud.video.transcoder.v1 + * @classdesc Represents a ListJobTemplatesResponse. + * @implements IListJobTemplatesResponse + * @constructor + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesResponse=} [properties] Properties to set + */ + function ListJobTemplatesResponse(properties) { + this.jobTemplates = []; + 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]]; + } + + /** + * ListJobTemplatesResponse jobTemplates. + * @member {Array.} jobTemplates + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @instance + */ + ListJobTemplatesResponse.prototype.jobTemplates = $util.emptyArray; + + /** + * ListJobTemplatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @instance + */ + ListJobTemplatesResponse.prototype.nextPageToken = ""; + + /** + * ListJobTemplatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @instance + */ + ListJobTemplatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobTemplatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesResponse=} [properties] Properties to set + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesResponse} ListJobTemplatesResponse instance + */ + ListJobTemplatesResponse.create = function create(properties) { + return new ListJobTemplatesResponse(properties); + }; + + /** + * Encodes the specified ListJobTemplatesResponse message. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesResponse} message ListJobTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTemplatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobTemplates != null && message.jobTemplates.length) + for (var i = 0; i < message.jobTemplates.length; ++i) + $root.google.cloud.video.transcoder.v1.JobTemplate.encode(message.jobTemplates[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 ListJobTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.ListJobTemplatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {google.cloud.video.transcoder.v1.IListJobTemplatesResponse} message ListJobTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobTemplatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesResponse} ListJobTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTemplatesResponse.decode = function 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.transcoder.v1.ListJobTemplatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobTemplates && message.jobTemplates.length)) + message.jobTemplates = []; + message.jobTemplates.push($root.google.cloud.video.transcoder.v1.JobTemplate.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 ListJobTemplatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesResponse} ListJobTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobTemplatesResponse message. + * @function verify + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobTemplatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobTemplates != null && message.hasOwnProperty("jobTemplates")) { + if (!Array.isArray(message.jobTemplates)) + return "jobTemplates: array expected"; + for (var i = 0; i < message.jobTemplates.length; ++i) { + var error = $root.google.cloud.video.transcoder.v1.JobTemplate.verify(message.jobTemplates[i]); + if (error) + return "jobTemplates." + 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 ListJobTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.video.transcoder.v1.ListJobTemplatesResponse} ListJobTemplatesResponse + */ + ListJobTemplatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.video.transcoder.v1.ListJobTemplatesResponse) + return object; + var message = new $root.google.cloud.video.transcoder.v1.ListJobTemplatesResponse(); + if (object.jobTemplates) { + if (!Array.isArray(object.jobTemplates)) + throw TypeError(".google.cloud.video.transcoder.v1.ListJobTemplatesResponse.jobTemplates: array expected"); + message.jobTemplates = []; + for (var i = 0; i < object.jobTemplates.length; ++i) { + if (typeof object.jobTemplates[i] !== "object") + throw TypeError(".google.cloud.video.transcoder.v1.ListJobTemplatesResponse.jobTemplates: object expected"); + message.jobTemplates[i] = $root.google.cloud.video.transcoder.v1.JobTemplate.fromObject(object.jobTemplates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.video.transcoder.v1.ListJobTemplatesResponse.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 ListJobTemplatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {google.cloud.video.transcoder.v1.ListJobTemplatesResponse} message ListJobTemplatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobTemplatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobTemplates = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobTemplates && message.jobTemplates.length) { + object.jobTemplates = []; + for (var j = 0; j < message.jobTemplates.length; ++j) + object.jobTemplates[j] = $root.google.cloud.video.transcoder.v1.JobTemplate.toObject(message.jobTemplates[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 ListJobTemplatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobTemplatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobTemplatesResponse + * @function getTypeUrl + * @memberof google.cloud.video.transcoder.v1.ListJobTemplatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"; + }; + + return ListJobTemplatesResponse; + })(); + + return v1; + })(); + + return transcoder; + })(); + + 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 + */ + + /** + * 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; + + /** + * 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.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; + } + 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"; + } + 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]); + } + 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.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.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; + })(); + + 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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-video-transcoder/protos/protos.json b/packages/google-cloud-video-transcoder/protos/protos.json new file mode 100644 index 00000000000..a77b260e2d5 --- /dev/null +++ b/packages/google-cloud-video-transcoder/protos/protos.json @@ -0,0 +1,2635 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "video": { + "nested": { + "transcoder": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/video/transcoder/v1;transcoder", + "java_multiple_files": true, + "java_outer_classname": "ServicesProto", + "java_package": "com.google.cloud.video.transcoder.v1", + "csharp_namespace": "Google.Cloud.Video.Transcoder.V1", + "php_namespace": "Google\\Cloud\\Video\\Transcoder\\V1", + "ruby_package": "Google::Cloud::Video::Transcoder::V1" + }, + "nested": { + "Job": { + "options": { + "(google.api.resource).type": "transcoder.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" + }, + "oneofs": { + "jobConfig": { + "oneof": [ + "templateId", + "config" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "outputUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "templateId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "config": { + "type": "JobConfig", + "id": 5 + }, + "state": { + "type": "ProcessingState", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ttlAfterCompletionDays": { + "type": "int32", + "id": 15 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "error": { + "type": "google.rpc.Status", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ProcessingState": { + "values": { + "PROCESSING_STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + } + } + }, + "JobTemplate": { + "options": { + "(google.api.resource).type": "transcoder.googleapis.com/JobTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobTemplates/{job_template}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "config": { + "type": "JobConfig", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "JobConfig": { + "fields": { + "inputs": { + "rule": "repeated", + "type": "Input", + "id": 1 + }, + "editList": { + "rule": "repeated", + "type": "EditAtom", + "id": 2 + }, + "elementaryStreams": { + "rule": "repeated", + "type": "ElementaryStream", + "id": 3 + }, + "muxStreams": { + "rule": "repeated", + "type": "MuxStream", + "id": 4 + }, + "manifests": { + "rule": "repeated", + "type": "Manifest", + "id": 5 + }, + "output": { + "type": "Output", + "id": 6 + }, + "adBreaks": { + "rule": "repeated", + "type": "AdBreak", + "id": 7 + }, + "pubsubDestination": { + "type": "PubsubDestination", + "id": 8 + }, + "spriteSheets": { + "rule": "repeated", + "type": "SpriteSheet", + "id": 9 + }, + "overlays": { + "rule": "repeated", + "type": "Overlay", + "id": 10 + } + } + }, + "Input": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "preprocessingConfig": { + "type": "PreprocessingConfig", + "id": 3 + } + } + }, + "Output": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "EditAtom": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "inputs": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + }, + "AdBreak": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "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 + }, + "fileName": { + "type": "string", + "id": 2 + }, + "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" + } + } + }, + "nested": { + "ManifestType": { + "values": { + "MANIFEST_TYPE_UNSPECIFIED": 0, + "HLS": 1, + "DASH": 2 + } + } + } + }, + "PubsubDestination": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, + "SpriteSheet": { + "oneofs": { + "extractionStrategy": { + "oneof": [ + "totalCount", + "interval" + ] + } + }, + "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 + }, + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 7 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "totalCount": { + "type": "int32", + "id": 9 + }, + "interval": { + "type": "google.protobuf.Duration", + "id": 10 + }, + "quality": { + "type": "int32", + "id": 11 + } + } + }, + "Overlay": { + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "animations": { + "rule": "repeated", + "type": "Animation", + "id": 2 + } + }, + "nested": { + "NormalizedCoordinate": { + "fields": { + "x": { + "type": "double", + "id": 1 + }, + "y": { + "type": "double", + "id": 2 + } + } + }, + "Image": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resolution": { + "type": "NormalizedCoordinate", + "id": 2 + }, + "alpha": { + "type": "double", + "id": 3 + } + } + }, + "AnimationStatic": { + "fields": { + "xy": { + "type": "NormalizedCoordinate", + "id": 1 + }, + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "FadeType": { + "values": { + "FADE_TYPE_UNSPECIFIED": 0, + "FADE_IN": 1, + "FADE_OUT": 2 + } + }, + "AnimationFade": { + "fields": { + "fadeType": { + "type": "FadeType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "xy": { + "type": "NormalizedCoordinate", + "id": 2 + }, + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + }, + "AnimationEnd": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "Animation": { + "oneofs": { + "animationType": { + "oneof": [ + "animationStatic", + "animationFade", + "animationEnd" + ] + } + }, + "fields": { + "animationStatic": { + "type": "AnimationStatic", + "id": 1 + }, + "animationFade": { + "type": "AnimationFade", + "id": 2 + }, + "animationEnd": { + "type": "AnimationEnd", + "id": 3 + } + } + } + } + }, + "PreprocessingConfig": { + "fields": { + "color": { + "type": "Color", + "id": 1 + }, + "denoise": { + "type": "Denoise", + "id": 2 + }, + "deblock": { + "type": "Deblock", + "id": 3 + }, + "audio": { + "type": "Audio", + "id": 4 + }, + "crop": { + "type": "Crop", + "id": 5 + }, + "pad": { + "type": "Pad", + "id": 6 + } + }, + "nested": { + "Color": { + "fields": { + "saturation": { + "type": "double", + "id": 1 + }, + "contrast": { + "type": "double", + "id": 2 + }, + "brightness": { + "type": "double", + "id": 3 + } + } + }, + "Denoise": { + "fields": { + "strength": { + "type": "double", + "id": 1 + }, + "tune": { + "type": "string", + "id": 2 + } + } + }, + "Deblock": { + "fields": { + "strength": { + "type": "double", + "id": 1 + }, + "enabled": { + "type": "bool", + "id": 2 + } + } + }, + "Audio": { + "fields": { + "lufs": { + "type": "double", + "id": 1 + }, + "highBoost": { + "type": "bool", + "id": 2 + }, + "lowBoost": { + "type": "bool", + "id": 3 + } + } + }, + "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", + "h265", + "vp9" + ] + } + }, + "fields": { + "h264": { + "type": "H264CodecSettings", + "id": 1 + }, + "h265": { + "type": "H265CodecSettings", + "id": 2 + }, + "vp9": { + "type": "Vp9CodecSettings", + "id": 3 + } + }, + "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" + } + }, + "pixelFormat": { + "type": "string", + "id": 5 + }, + "rateControlMode": { + "type": "string", + "id": 6 + }, + "crfLevel": { + "type": "int32", + "id": 7 + }, + "allowOpenGop": { + "type": "bool", + "id": 8 + }, + "gopFrameCount": { + "type": "int32", + "id": 9 + }, + "gopDuration": { + "type": "google.protobuf.Duration", + "id": 10 + }, + "enableTwoPass": { + "type": "bool", + "id": 11 + }, + "vbvSizeBits": { + "type": "int32", + "id": 12 + }, + "vbvFullnessBits": { + "type": "int32", + "id": 13 + }, + "entropyCoder": { + "type": "string", + "id": 14 + }, + "bPyramid": { + "type": "bool", + "id": 15 + }, + "bFrameCount": { + "type": "int32", + "id": 16 + }, + "aqStrength": { + "type": "double", + "id": 17 + }, + "profile": { + "type": "string", + "id": 18 + }, + "tune": { + "type": "string", + "id": 19 + }, + "preset": { + "type": "string", + "id": 20 + } + } + }, + "H265CodecSettings": { + "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" + } + }, + "pixelFormat": { + "type": "string", + "id": 5 + }, + "rateControlMode": { + "type": "string", + "id": 6 + }, + "crfLevel": { + "type": "int32", + "id": 7 + }, + "allowOpenGop": { + "type": "bool", + "id": 8 + }, + "gopFrameCount": { + "type": "int32", + "id": 9 + }, + "gopDuration": { + "type": "google.protobuf.Duration", + "id": 10 + }, + "enableTwoPass": { + "type": "bool", + "id": 11 + }, + "vbvSizeBits": { + "type": "int32", + "id": 12 + }, + "vbvFullnessBits": { + "type": "int32", + "id": 13 + }, + "bPyramid": { + "type": "bool", + "id": 14 + }, + "bFrameCount": { + "type": "int32", + "id": 15 + }, + "aqStrength": { + "type": "double", + "id": 16 + }, + "profile": { + "type": "string", + "id": 17 + }, + "tune": { + "type": "string", + "id": 18 + }, + "preset": { + "type": "string", + "id": 19 + } + } + }, + "Vp9CodecSettings": { + "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" + } + }, + "pixelFormat": { + "type": "string", + "id": 5 + }, + "rateControlMode": { + "type": "string", + "id": 6 + }, + "crfLevel": { + "type": "int32", + "id": 7 + }, + "gopFrameCount": { + "type": "int32", + "id": 8 + }, + "gopDuration": { + "type": "google.protobuf.Duration", + "id": 9 + }, + "profile": { + "type": "string", + "id": 10 + } + } + } + } + }, + "AudioStream": { + "fields": { + "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": { + "atomKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputTrack": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputChannel": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputChannel": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gainDb": { + "type": "double", + "id": 6 + } + } + } + } + }, + "TextStream": { + "fields": { + "codec": { + "type": "string", + "id": 1 + }, + "mapping": { + "rule": "repeated", + "type": "TextMapping", + "id": 3 + } + }, + "nested": { + "TextMapping": { + "fields": { + "atomKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputTrack": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "SegmentSettings": { + "fields": { + "segmentDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "individualSegments": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranscoderService": { + "options": { + "(google.api.default_host)": "transcoder.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/jobs", + "(google.api.http).body": "job", + "(google.api.method_signature)": "parent,job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/jobs", + "body": "job" + } + }, + { + "(google.api.method_signature)": "parent,job" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/jobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateJobTemplate": { + "requestType": "CreateJobTemplateRequest", + "responseType": "JobTemplate", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/jobTemplates", + "(google.api.http).body": "job_template", + "(google.api.method_signature)": "parent,job_template,job_template_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/jobTemplates", + "body": "job_template" + } + }, + { + "(google.api.method_signature)": "parent,job_template,job_template_id" + } + ] + }, + "ListJobTemplates": { + "requestType": "ListJobTemplatesRequest", + "responseType": "ListJobTemplatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/jobTemplates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/jobTemplates" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetJobTemplate": { + "requestType": "GetJobTemplateRequest", + "responseType": "JobTemplate", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/jobTemplates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteJobTemplate": { + "requestType": "DeleteJobTemplateRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/jobTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/jobTemplates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "job": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "transcoder.googleapis.com/Job" + } + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "transcoder.googleapis.com/Job" + } + }, + "allowMissing": { + "type": "bool", + "id": 2 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "CreateJobTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "jobTemplate": { + "type": "JobTemplate", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobTemplateId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListJobTemplatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "GetJobTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "transcoder.googleapis.com/JobTemplate" + } + } + } + }, + "DeleteJobTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "transcoder.googleapis.com/JobTemplate" + } + }, + "allowMissing": { + "type": "bool", + "id": 2 + } + } + }, + "ListJobTemplatesResponse": { + "fields": { + "jobTemplates": { + "rule": "repeated", + "type": "JobTemplate", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + } + } + } + } + } + } + }, + "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": {} + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-video-transcoder/samples/README.md b/packages/google-cloud-video-transcoder/samples/README.md new file mode 100644 index 00000000000..e61d73ffa35 --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/README.md @@ -0,0 +1,374 @@ +[//]: # "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 + +# [Transcoder API: Node.js Samples](https://github.com/googleapis/nodejs-video-transcoder) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Create Job From Ad Hoc](#create-job-from-ad-hoc) + * [Create Job From Preset](#create-job-from-preset) + * [Create Job From Template](#create-job-from-template) + * [Create Job Template](#create-job-template) + * [Create Job With Animated Overlay](#create-job-with-animated-overlay) + * [Create Job With Concatenated Inputs](#create-job-with-concatenated-inputs) + * [Create Job With Embedded Captions](#create-job-with-embedded-captions) + * [Create Job With Periodic Images Spritesheet](#create-job-with-periodic-images-spritesheet) + * [Create Job With Set Number Images Spritesheet](#create-job-with-set-number-images-spritesheet) + * [Create Job With Standalone Captions](#create-job-with-standalone-captions) + * [Create Job With Static Overlay](#create-job-with-static-overlay) + * [Delete Job](#delete-job) + * [Delete Job Template](#delete-job-template) + * [Get Job](#get-job) + * [Get Job State](#get-job-state) + * [Get Job Template](#get-job-template) + * [List Job Templates](#list-job-templates) + * [List Jobs](#list-jobs) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-video-transcoder#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Create Job From Ad Hoc + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobFromAdHoc.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobFromAdHoc.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobFromAdHoc.js` + + +----- + + + + +### Create Job From Preset + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobFromPreset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobFromPreset.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobFromPreset.js` + + +----- + + + + +### Create Job From Template + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobFromTemplate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobFromTemplate.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobFromTemplate.js` + + +----- + + + + +### Create Job Template + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobTemplate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobTemplate.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobTemplate.js` + + +----- + + + + +### Create Job With Animated Overlay + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithAnimatedOverlay.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithAnimatedOverlay.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithAnimatedOverlay.js` + + +----- + + + + +### Create Job With Concatenated Inputs + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithConcatenatedInputs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithConcatenatedInputs.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithConcatenatedInputs.js` + + +----- + + + + +### Create Job With Embedded Captions + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithEmbeddedCaptions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithEmbeddedCaptions.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithEmbeddedCaptions.js` + + +----- + + + + +### Create Job With Periodic Images Spritesheet + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithPeriodicImagesSpritesheet.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithPeriodicImagesSpritesheet.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithPeriodicImagesSpritesheet.js` + + +----- + + + + +### Create Job With Set Number Images Spritesheet + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithSetNumberImagesSpritesheet.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithSetNumberImagesSpritesheet.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithSetNumberImagesSpritesheet.js` + + +----- + + + + +### Create Job With Standalone Captions + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithStandaloneCaptions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithStandaloneCaptions.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithStandaloneCaptions.js` + + +----- + + + + +### Create Job With Static Overlay + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/createJobWithStaticOverlay.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/createJobWithStaticOverlay.js,samples/README.md) + +__Usage:__ + + +`node samples/createJobWithStaticOverlay.js` + + +----- + + + + +### Delete Job + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/deleteJob.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/deleteJob.js,samples/README.md) + +__Usage:__ + + +`node samples/deleteJob.js` + + +----- + + + + +### Delete Job Template + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/deleteJobTemplate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/deleteJobTemplate.js,samples/README.md) + +__Usage:__ + + +`node samples/deleteJobTemplate.js` + + +----- + + + + +### Get Job + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/getJob.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/getJob.js,samples/README.md) + +__Usage:__ + + +`node samples/getJob.js` + + +----- + + + + +### Get Job State + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/getJobState.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/getJobState.js,samples/README.md) + +__Usage:__ + + +`node samples/getJobState.js` + + +----- + + + + +### Get Job Template + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/getJobTemplate.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/getJobTemplate.js,samples/README.md) + +__Usage:__ + + +`node samples/getJobTemplate.js` + + +----- + + + + +### List Job Templates + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/listJobTemplates.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/listJobTemplates.js,samples/README.md) + +__Usage:__ + + +`node samples/listJobTemplates.js` + + +----- + + + + +### List Jobs + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/listJobs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/listJobs.js,samples/README.md) + +__Usage:__ + + +`node samples/listJobs.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-video-transcoder/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-transcoder&page=editor&open_in_editor=samples/README.md +[product-docs]: https://googleapis.dev/nodejs/transcoder/latest diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/snippet_metadata.google.cloud.video.transcoder.v1.json b/packages/google-cloud-video-transcoder/samples/generated/v1/snippet_metadata.google.cloud.video.transcoder.v1.json new file mode 100644 index 00000000000..62d981d1bc2 --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/snippet_metadata.google.cloud.video.transcoder.v1.json @@ -0,0 +1,387 @@ +{ + "clientLibrary": { + "name": "nodejs-transcoder", + "version": "2.2.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.video.transcoder.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "transcoder_v1_generated_TranscoderService_CreateJob_async", + "title": "TranscoderService createJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a job in the specified region.", + "canonical": true, + "file": "transcoder_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.video.transcoder.v1.Job" + } + ], + "resultType": ".google.cloud.video.transcoder.v1.Job", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.CreateJob", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_ListJobs_async", + "title": "TranscoderService listJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists jobs in the specified region.", + "canonical": true, + "file": "transcoder_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.ListJobs", + "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.transcoder.v1.ListJobsResponse", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.ListJobs", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_GetJob_async", + "title": "TranscoderService getJob Sample", + "origin": "API_DEFINITION", + "description": " Returns the job data.", + "canonical": true, + "file": "transcoder_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.transcoder.v1.Job", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.GetJob", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_DeleteJob_async", + "title": "TranscoderService deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes a job.", + "canonical": true, + "file": "transcoder_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.DeleteJob", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_CreateJobTemplate_async", + "title": "TranscoderService createJobTemplate Sample", + "origin": "API_DEFINITION", + "description": " Creates a job template in the specified region.", + "canonical": true, + "file": "transcoder_service.create_job_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJobTemplate", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.CreateJobTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job_template", + "type": ".google.cloud.video.transcoder.v1.JobTemplate" + }, + { + "name": "job_template_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.transcoder.v1.JobTemplate", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "CreateJobTemplate", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.CreateJobTemplate", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_ListJobTemplates_async", + "title": "TranscoderService listJobTemplates Sample", + "origin": "API_DEFINITION", + "description": " Lists job templates in the specified region.", + "canonical": true, + "file": "transcoder_service.list_job_templates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobTemplates", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.ListJobTemplates", + "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.transcoder.v1.ListJobTemplatesResponse", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "ListJobTemplates", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.ListJobTemplates", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_GetJobTemplate_async", + "title": "TranscoderService getJobTemplate Sample", + "origin": "API_DEFINITION", + "description": " Returns the job template data.", + "canonical": true, + "file": "transcoder_service.get_job_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJobTemplate", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.GetJobTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.video.transcoder.v1.JobTemplate", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "GetJobTemplate", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.GetJobTemplate", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + }, + { + "regionTag": "transcoder_v1_generated_TranscoderService_DeleteJobTemplate_async", + "title": "TranscoderService deleteJobTemplate Sample", + "origin": "API_DEFINITION", + "description": " Deletes a job template.", + "canonical": true, + "file": "transcoder_service.delete_job_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJobTemplate", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.DeleteJobTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "TranscoderServiceClient", + "fullName": "google.cloud.video.transcoder.v1.TranscoderServiceClient" + }, + "method": { + "shortName": "DeleteJobTemplate", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService.DeleteJobTemplate", + "service": { + "shortName": "TranscoderService", + "fullName": "google.cloud.video.transcoder.v1.TranscoderService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js new file mode 100644 index 00000000000..d82dfe261ac --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js @@ -0,0 +1,67 @@ +// 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, job) { + // [START transcoder_v1_generated_TranscoderService_CreateJob_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 to create and process this job. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. Parameters for creating transcoding job. + */ + // const job = {} + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await transcoderClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END transcoder_v1_generated_TranscoderService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js new file mode 100644 index 00000000000..2e2e80f2111 --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, jobTemplate, jobTemplateId) { + // [START transcoder_v1_generated_TranscoderService_CreateJobTemplate_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 to create this job template. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. Parameters for creating job template. + */ + // const jobTemplate = {} + /** + * Required. The ID to use for the job template, which will become the final component + * of the job template's resource name. + * This value should be 4-63 characters, and valid characters must match the + * regular expression `[a-zA-Z][a-zA-Z0-9_-]*`. + */ + // const jobTemplateId = 'abc123' + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callCreateJobTemplate() { + // Construct request + const request = { + parent, + jobTemplate, + jobTemplateId, + }; + + // Run request + const response = await transcoderClient.createJobTemplate(request); + console.log(response); + } + + callCreateJobTemplate(); + // [END transcoder_v1_generated_TranscoderService_CreateJobTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js new file mode 100644 index 00000000000..409f20f16db --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js @@ -0,0 +1,67 @@ +// 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 transcoder_v1_generated_TranscoderService_DeleteJob_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 job to delete. + * Format: `projects/{project}/locations/{location}/jobs/{job}` + */ + // const name = 'abc123' + /** + * If set to true, and the job is not found, the request will succeed but no + * action will be taken on the server. + */ + // const allowMissing = true + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await transcoderClient.deleteJob(request); + console.log(response); + } + + callDeleteJob(); + // [END transcoder_v1_generated_TranscoderService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js new file mode 100644 index 00000000000..54659c7134a --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js @@ -0,0 +1,67 @@ +// 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 transcoder_v1_generated_TranscoderService_DeleteJobTemplate_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 job template to delete. + * `projects/{project}/locations/{location}/jobTemplates/{job_template}` + */ + // const name = 'abc123' + /** + * If set to true, and the job template is not found, the request will succeed + * but no action will be taken on the server. + */ + // const allowMissing = true + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callDeleteJobTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await transcoderClient.deleteJobTemplate(request); + console.log(response); + } + + callDeleteJobTemplate(); + // [END transcoder_v1_generated_TranscoderService_DeleteJobTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.js new file mode 100644 index 00000000000..f350faa246d --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.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 transcoder_v1_generated_TranscoderService_GetJob_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 job to retrieve. + * Format: `projects/{project}/locations/{location}/jobs/{job}` + */ + // const name = 'abc123' + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await transcoderClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END transcoder_v1_generated_TranscoderService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js new file mode 100644 index 00000000000..5e5f5d344d5 --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START transcoder_v1_generated_TranscoderService_GetJobTemplate_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 job template to retrieve. + * Format: + * `projects/{project}/locations/{location}/jobTemplates/{job_template}` + */ + // const name = 'abc123' + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callGetJobTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await transcoderClient.getJobTemplate(request); + console.log(response); + } + + callGetJobTemplate(); + // [END transcoder_v1_generated_TranscoderService_GetJobTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js new file mode 100644 index 00000000000..51356b1063a --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js @@ -0,0 +1,83 @@ +// 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 transcoder_v1_generated_TranscoderService_ListJobTemplates_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 from which to retrieve the collection of job templates. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The `next_page_token` value returned from a previous List request, if + * any. + */ + // const pageToken = 'abc123' + /** + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + */ + // const filter = 'abc123' + /** + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + */ + // const orderBy = 'abc123' + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callListJobTemplates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await transcoderClient.listJobTemplatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobTemplates(); + // [END transcoder_v1_generated_TranscoderService_ListJobTemplates_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js new file mode 100644 index 00000000000..4f7dd7599ca --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js @@ -0,0 +1,82 @@ +// 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 transcoder_v1_generated_TranscoderService_ListJobs_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. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The `next_page_token` value returned from a previous List request, if + * any. + */ + // const pageToken = 'abc123' + /** + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + */ + // const filter = 'abc123' + /** + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + */ + // const orderBy = 'abc123' + + // Imports the Transcoder library + const {TranscoderServiceClient} = require('@google-cloud/video-transcoder').v1; + + // Instantiates a client + const transcoderClient = new TranscoderServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await transcoderClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END transcoder_v1_generated_TranscoderService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/package.json b/packages/google-cloud-video-transcoder/samples/package.json new file mode 100644 index 00000000000..24b23129bdb --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-video-transcoder-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js", + "!test" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/video-transcoder": "^2.2.3" + }, + "devDependencies": { + "@google-cloud/storage": "^6.0.0", + "c8": "^7.3.0", + "mocha": "^8.1.1", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-cloud-video-transcoder/samples/quickstart.js b/packages/google-cloud-video-transcoder/samples/quickstart.js new file mode 100644 index 00000000000..78e00252ebf --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/quickstart.js @@ -0,0 +1,44 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +async function main(projectId, location) { + // [START video_transcoder_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'my-project'; + // const location = 'us-central1'; + const {TranscoderServiceClient} = + require('@google-cloud/video-transcoder').v1; + const client = new TranscoderServiceClient(); + async function listJobs() { + const [jobs] = await client.listJobs({ + parent: client.locationPath(projectId, location), + }); + console.info('jobs:'); + for (const job of jobs) { + console.info(job); + } + } + listJobs(); + // [END video_transcoder_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-video-transcoder/samples/test/quickstart.js b/packages/google-cloud-video-transcoder/samples/test/quickstart.js new file mode 100644 index 00000000000..e9a98ad11e6 --- /dev/null +++ b/packages/google-cloud-video-transcoder/samples/test/quickstart.js @@ -0,0 +1,35 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const path = require('path'); +const assert = require('assert'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const project = process.env.GCLOUD_PROJECT; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const output = execSync(`node ./quickstart.js ${project} us-west1`, { + cwd, + }); + assert(output.match(/jobs:/)); + }); +}); diff --git a/packages/google-cloud-video-transcoder/src/index.ts b/packages/google-cloud-video-transcoder/src/index.ts new file mode 100644 index 00000000000..e9e38177176 --- /dev/null +++ b/packages/google-cloud-video-transcoder/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const TranscoderServiceClient = v1.TranscoderServiceClient; +type TranscoderServiceClient = v1.TranscoderServiceClient; + +export {v1, TranscoderServiceClient}; +export default {v1, TranscoderServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-video-transcoder/src/v1/gapic_metadata.json b/packages/google-cloud-video-transcoder/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..5898b0efba3 --- /dev/null +++ b/packages/google-cloud-video-transcoder/src/v1/gapic_metadata.json @@ -0,0 +1,111 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.video.transcoder.v1", + "libraryPackage": "@google-cloud/video-transcoder", + "services": { + "TranscoderService": { + "clients": { + "grpc": { + "libraryClient": "TranscoderServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "CreateJobTemplate": { + "methods": [ + "createJobTemplate" + ] + }, + "GetJobTemplate": { + "methods": [ + "getJobTemplate" + ] + }, + "DeleteJobTemplate": { + "methods": [ + "deleteJobTemplate" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListJobTemplates": { + "methods": [ + "listJobTemplates", + "listJobTemplatesStream", + "listJobTemplatesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TranscoderServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "CreateJobTemplate": { + "methods": [ + "createJobTemplate" + ] + }, + "GetJobTemplate": { + "methods": [ + "getJobTemplate" + ] + }, + "DeleteJobTemplate": { + "methods": [ + "deleteJobTemplate" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListJobTemplates": { + "methods": [ + "listJobTemplates", + "listJobTemplatesStream", + "listJobTemplatesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-video-transcoder/src/v1/index.ts b/packages/google-cloud-video-transcoder/src/v1/index.ts new file mode 100644 index 00000000000..2f52b1a6d4d --- /dev/null +++ b/packages/google-cloud-video-transcoder/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 {TranscoderServiceClient} from './transcoder_service_client'; diff --git a/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client.ts b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client.ts new file mode 100644 index 00000000000..db0d57207b3 --- /dev/null +++ b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client.ts @@ -0,0 +1,1513 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/transcoder_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './transcoder_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Using the Transcoder API, you can queue asynchronous jobs for transcoding + * media into various output formats. Output formats may include different + * streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive + * Streaming over HTTP (DASH). You can also customize jobs using advanced + * features such as Digital Rights Management (DRM), audio equalization, content + * concatenation, and digital ad-stitch ready content generation. + * @class + * @memberof v1 + */ +export class TranscoderServiceClient { + 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}; + transcoderServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TranscoderServiceClient. + * + * @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 TranscoderServiceClient({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 TranscoderServiceClient; + 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 = { + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ), + jobTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobTemplates/{job_template}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + }; + + // 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 = { + listJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + listJobTemplates: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobTemplates' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.video.transcoder.v1.TranscoderService', + 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.transcoderServiceStub) { + return this.transcoderServiceStub; + } + + // Put together the "service stub" for + // google.cloud.video.transcoder.v1.TranscoderService. + this.transcoderServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.video.transcoder.v1.TranscoderService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.video.transcoder.v1 + .TranscoderService, + 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 transcoderServiceStubMethods = [ + 'createJob', + 'listJobs', + 'getJob', + 'deleteJob', + 'createJobTemplate', + 'listJobTemplates', + 'getJobTemplate', + 'deleteJobTemplate', + ]; + for (const methodName of transcoderServiceStubMethods) { + const callPromise = this.transcoderServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.transcoderServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'transcoder.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 'transcoder.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 -- + // ------------------- + /** + * Creates a job in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location to create and process this job. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.video.transcoder.v1.Job} request.job + * Required. Parameters for creating transcoding job. + * @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 [Job]{@link google.cloud.video.transcoder.v1.Job}. + * 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/transcoder_service.create_job.js + * region_tag:transcoder_v1_generated_TranscoderService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.video.transcoder.v1.ICreateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.ICreateJobRequest | undefined, + {} | undefined + ] + >; + createJob( + request: protos.google.cloud.video.transcoder.v1.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJob, + | protos.google.cloud.video.transcoder.v1.ICreateJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createJob( + request: protos.google.cloud.video.transcoder.v1.ICreateJobRequest, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJob, + | protos.google.cloud.video.transcoder.v1.ICreateJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createJob( + request?: protos.google.cloud.video.transcoder.v1.ICreateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.transcoder.v1.IJob, + | protos.google.cloud.video.transcoder.v1.ICreateJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.transcoder.v1.IJob, + | protos.google.cloud.video.transcoder.v1.ICreateJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.ICreateJobRequest | 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.createJob(request, options, callback); + } + /** + * Returns the job data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the job to retrieve. + * Format: `projects/{project}/locations/{location}/jobs/{job}` + * @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 [Job]{@link google.cloud.video.transcoder.v1.Job}. + * 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/transcoder_service.get_job.js + * region_tag:transcoder_v1_generated_TranscoderService_GetJob_async + */ + getJob( + request?: protos.google.cloud.video.transcoder.v1.IGetJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.IGetJobRequest | undefined, + {} | undefined + ] + >; + getJob( + request: protos.google.cloud.video.transcoder.v1.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request: protos.google.cloud.video.transcoder.v1.IGetJobRequest, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request?: protos.google.cloud.video.transcoder.v1.IGetJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.transcoder.v1.IJob, + | protos.google.cloud.video.transcoder.v1.IGetJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJob, + protos.google.cloud.video.transcoder.v1.IGetJobRequest | 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.getJob(request, options, callback); + } + /** + * Deletes a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the job to delete. + * Format: `projects/{project}/locations/{location}/jobs/{job}` + * @param {boolean} request.allowMissing + * If set to true, and the job is not found, the request will succeed but no + * action will be taken on the server. + * @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/transcoder_service.delete_job.js + * region_tag:transcoder_v1_generated_TranscoderService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.video.transcoder.v1.IDeleteJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.video.transcoder.v1.IDeleteJobRequest | undefined, + {} | undefined + ] + >; + deleteJob( + request: protos.google.cloud.video.transcoder.v1.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteJob( + request: protos.google.cloud.video.transcoder.v1.IDeleteJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteJob( + request?: protos.google.cloud.video.transcoder.v1.IDeleteJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.video.transcoder.v1.IDeleteJobRequest | 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.deleteJob(request, options, callback); + } + /** + * Creates a job template in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location to create this job template. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.video.transcoder.v1.JobTemplate} request.jobTemplate + * Required. Parameters for creating job template. + * @param {string} request.jobTemplateId + * Required. The ID to use for the job template, which will become the final component + * of the job template's resource name. + * + * This value should be 4-63 characters, and valid characters must match the + * regular expression `{@link a-zA-Z0-9_-|a-zA-Z}*`. + * @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 [JobTemplate]{@link google.cloud.video.transcoder.v1.JobTemplate}. + * 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/transcoder_service.create_job_template.js + * region_tag:transcoder_v1_generated_TranscoderService_CreateJobTemplate_async + */ + createJobTemplate( + request?: protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJobTemplate, + ( + | protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest + | undefined + ), + {} | undefined + ] + >; + createJobTemplate( + request: protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createJobTemplate( + request: protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createJobTemplate( + request?: protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJobTemplate, + ( + | protos.google.cloud.video.transcoder.v1.ICreateJobTemplateRequest + | 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.createJobTemplate(request, options, callback); + } + /** + * Returns the job template data. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the job template to retrieve. + * Format: + * `projects/{project}/locations/{location}/jobTemplates/{job_template}` + * @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 [JobTemplate]{@link google.cloud.video.transcoder.v1.JobTemplate}. + * 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/transcoder_service.get_job_template.js + * region_tag:transcoder_v1_generated_TranscoderService_GetJobTemplate_async + */ + getJobTemplate( + request?: protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJobTemplate, + ( + | protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest + | undefined + ), + {} | undefined + ] + >; + getJobTemplate( + request: protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getJobTemplate( + request: protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest, + callback: Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getJobTemplate( + request?: protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.video.transcoder.v1.IJobTemplate, + | protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJobTemplate, + ( + | protos.google.cloud.video.transcoder.v1.IGetJobTemplateRequest + | 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.getJobTemplate(request, options, callback); + } + /** + * Deletes a job template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the job template to delete. + * `projects/{project}/locations/{location}/jobTemplates/{job_template}` + * @param {boolean} request.allowMissing + * If set to true, and the job template is not found, the request will succeed + * but no action will be taken on the server. + * @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/transcoder_service.delete_job_template.js + * region_tag:transcoder_v1_generated_TranscoderService_DeleteJobTemplate_async + */ + deleteJobTemplate( + request?: protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest + | undefined + ), + {} | undefined + ] + >; + deleteJobTemplate( + request: protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteJobTemplate( + request: protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteJobTemplate( + request?: protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.video.transcoder.v1.IDeleteJobTemplateRequest + | 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.deleteJobTemplate(request, options, callback); + } + + /** + * Lists jobs in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if + * any. + * @param {string} request.filter + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + * @param {string} request.orderBy + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + * @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 [Job]{@link google.cloud.video.transcoder.v1.Job}. + * 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 `listJobsAsync()` + * 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. + */ + listJobs( + request?: protos.google.cloud.video.transcoder.v1.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJob[], + protos.google.cloud.video.transcoder.v1.IListJobsRequest | null, + protos.google.cloud.video.transcoder.v1.IListJobsResponse + ] + >; + listJobs( + request: protos.google.cloud.video.transcoder.v1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobsRequest, + | protos.google.cloud.video.transcoder.v1.IListJobsResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJob + > + ): void; + listJobs( + request: protos.google.cloud.video.transcoder.v1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobsRequest, + | protos.google.cloud.video.transcoder.v1.IListJobsResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJob + > + ): void; + listJobs( + request?: protos.google.cloud.video.transcoder.v1.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobsRequest, + | protos.google.cloud.video.transcoder.v1.IListJobsResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJob + >, + callback?: PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobsRequest, + | protos.google.cloud.video.transcoder.v1.IListJobsResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJob + > + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJob[], + protos.google.cloud.video.transcoder.v1.IListJobsRequest | null, + protos.google.cloud.video.transcoder.v1.IListJobsResponse + ] + > | 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.listJobs(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. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if + * any. + * @param {string} request.filter + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + * @param {string} request.orderBy + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + * @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 [Job]{@link google.cloud.video.transcoder.v1.Job} 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 `listJobsAsync()` + * 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. + */ + listJobsStream( + request?: protos.google.cloud.video.transcoder.v1.IListJobsRequest, + 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['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobs`, 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. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if + * any. + * @param {string} request.filter + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + * @param {string} request.orderBy + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + * @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 + * [Job]{@link google.cloud.video.transcoder.v1.Job}. 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/transcoder_service.list_jobs.js + * region_tag:transcoder_v1_generated_TranscoderService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.video.transcoder.v1.IListJobsRequest, + 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['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists job templates in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location from which to retrieve the collection of job templates. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if + * any. + * @param {string} request.filter + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + * @param {string} request.orderBy + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + * @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 [JobTemplate]{@link google.cloud.video.transcoder.v1.JobTemplate}. + * 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 `listJobTemplatesAsync()` + * 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. + */ + listJobTemplates( + request?: protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJobTemplate[], + protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest | null, + protos.google.cloud.video.transcoder.v1.IListJobTemplatesResponse + ] + >; + listJobTemplates( + request: protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + | protos.google.cloud.video.transcoder.v1.IListJobTemplatesResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJobTemplate + > + ): void; + listJobTemplates( + request: protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + callback: PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + | protos.google.cloud.video.transcoder.v1.IListJobTemplatesResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJobTemplate + > + ): void; + listJobTemplates( + request?: protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + | protos.google.cloud.video.transcoder.v1.IListJobTemplatesResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJobTemplate + >, + callback?: PaginationCallback< + protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + | protos.google.cloud.video.transcoder.v1.IListJobTemplatesResponse + | null + | undefined, + protos.google.cloud.video.transcoder.v1.IJobTemplate + > + ): Promise< + [ + protos.google.cloud.video.transcoder.v1.IJobTemplate[], + protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest | null, + protos.google.cloud.video.transcoder.v1.IListJobTemplatesResponse + ] + > | 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.listJobTemplates(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 from which to retrieve the collection of job templates. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if + * any. + * @param {string} request.filter + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + * @param {string} request.orderBy + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + * @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 [JobTemplate]{@link google.cloud.video.transcoder.v1.JobTemplate} 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 `listJobTemplatesAsync()` + * 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. + */ + listJobTemplatesStream( + request?: protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + 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['listJobTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobTemplates.createStream( + this.innerApiCalls.listJobTemplates as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobTemplates`, 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 from which to retrieve the collection of job templates. + * Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The `next_page_token` value returned from a previous List request, if + * any. + * @param {string} request.filter + * The filter expression, following the syntax outlined in + * https://google.aip.dev/160. + * @param {string} request.orderBy + * One or more fields to compare and use to sort the output. + * See https://google.aip.dev/132#ordering. + * @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 + * [JobTemplate]{@link google.cloud.video.transcoder.v1.JobTemplate}. 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/transcoder_service.list_job_templates.js + * region_tag:transcoder_v1_generated_TranscoderService_ListJobTemplates_async + */ + listJobTemplatesAsync( + request?: protos.google.cloud.video.transcoder.v1.IListJobTemplatesRequest, + 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['listJobTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobTemplates.asyncIterate( + this.innerApiCalls['listJobTemplates'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project: string, location: string, job: string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified jobTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job_template + * @returns {string} Resource name string. + */ + jobTemplatePath(project: string, location: string, jobTemplate: string) { + return this.pathTemplates.jobTemplatePathTemplate.render({ + project: project, + location: location, + job_template: jobTemplate, + }); + } + + /** + * Parse the project from JobTemplate resource. + * + * @param {string} jobTemplateName + * A fully-qualified path representing JobTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobTemplateName(jobTemplateName: string) { + return this.pathTemplates.jobTemplatePathTemplate.match(jobTemplateName) + .project; + } + + /** + * Parse the location from JobTemplate resource. + * + * @param {string} jobTemplateName + * A fully-qualified path representing JobTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobTemplateName(jobTemplateName: string) { + return this.pathTemplates.jobTemplatePathTemplate.match(jobTemplateName) + .location; + } + + /** + * Parse the job_template from JobTemplate resource. + * + * @param {string} jobTemplateName + * A fully-qualified path representing JobTemplate resource. + * @returns {string} A string representing the job_template. + */ + matchJobTemplateFromJobTemplateName(jobTemplateName: string) { + return this.pathTemplates.jobTemplatePathTemplate.match(jobTemplateName) + .job_template; + } + + /** + * 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; + } + + /** + * 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.transcoderServiceStub && !this._terminated) { + return this.transcoderServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client_config.json b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client_config.json new file mode 100644 index 00000000000..0217861fc90 --- /dev/null +++ b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.video.transcoder.v1.TranscoderService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateJobTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobTemplates": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJobTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteJobTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-video-transcoder/src/v1/transcoder_service_proto_list.json b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_proto_list.json new file mode 100644 index 00000000000..b948cd53075 --- /dev/null +++ b/packages/google-cloud-video-transcoder/src/v1/transcoder_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/video/transcoder/v1/resources.proto", + "../../protos/google/cloud/video/transcoder/v1/services.proto" +] diff --git a/packages/google-cloud-video-transcoder/system-test/fixtures/sample/src/index.js b/packages/google-cloud-video-transcoder/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..280d21b0966 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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 transcoder = require('@google-cloud/video-transcoder'); + +function main() { + const transcoderServiceClient = new transcoder.TranscoderServiceClient(); +} + +main(); diff --git a/packages/google-cloud-video-transcoder/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-video-transcoder/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bb267c52602 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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 {TranscoderServiceClient} from '@google-cloud/video-transcoder'; + +// check that the client class type name can be used +function doStuffWithTranscoderServiceClient(client: TranscoderServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const transcoderServiceClient = new TranscoderServiceClient(); + doStuffWithTranscoderServiceClient(transcoderServiceClient); +} + +main(); diff --git a/packages/google-cloud-video-transcoder/system-test/install.ts b/packages/google-cloud-video-transcoder/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-video-transcoder/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-transcoder/test/gapic_transcoder_service_v1.ts b/packages/google-cloud-video-transcoder/test/gapic_transcoder_service_v1.ts new file mode 100644 index 00000000000..32ce3a22edb --- /dev/null +++ b/packages/google-cloud-video-transcoder/test/gapic_transcoder_service_v1.ts @@ -0,0 +1,1834 @@ +// 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 transcoderserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.TranscoderServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + transcoderserviceModule.v1.TranscoderServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + transcoderserviceModule.v1.TranscoderServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = transcoderserviceModule.v1.TranscoderServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.transcoderServiceStub, undefined); + await client.initialize(); + assert(client.transcoderServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.transcoderServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.transcoderServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + 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 transcoderserviceModule.v1.TranscoderServiceClient({ + 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('createJob', () => { + it('invokes createJob without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ); + client.innerApiCalls.createJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.transcoder.v1.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.transcoder.v1.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + 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.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with closed client', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteJob(request), expectedError); + }); + }); + + describe('createJobTemplate', () => { + it('invokes createJobTemplate without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobTemplateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ); + client.innerApiCalls.createJobTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.createJobTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJobTemplate without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobTemplateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ); + client.innerApiCalls.createJobTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJobTemplate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.transcoder.v1.IJobTemplate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJobTemplate with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobTemplateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJobTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createJobTemplate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJobTemplate with closed client', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.CreateJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.CreateJobTemplateRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJobTemplate(request), expectedError); + }); + }); + + describe('getJobTemplate', () => { + it('invokes getJobTemplate without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ); + client.innerApiCalls.getJobTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.getJobTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobTemplate without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ); + client.innerApiCalls.getJobTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJobTemplate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.transcoder.v1.IJobTemplate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobTemplate with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJobTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getJobTemplate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobTemplate with closed client', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.GetJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.GetJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJobTemplate(request), expectedError); + }); + }); + + describe('deleteJobTemplate', () => { + it('invokes deleteJobTemplate without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJobTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJobTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJobTemplate without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJobTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJobTemplate( + 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.deleteJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJobTemplate with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJobTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteJobTemplate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteJobTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJobTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJobTemplate with closed client', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.DeleteJobTemplateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteJobTemplate(request), expectedError); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + ]; + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.video.transcoder.v1.IJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + ]; + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.transcoder.v1.Job[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.transcoder.v1.Job) => { + 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.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.transcoder.v1.Job[] = []; + stream.on( + 'data', + (response: protos.google.cloud.video.transcoder.v1.Job) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.Job() + ), + ]; + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.transcoder.v1.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.transcoder.v1.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listJobTemplates', () => { + it('invokes listJobTemplates without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + ]; + client.innerApiCalls.listJobTemplates = stubSimpleCall(expectedResponse); + const [response] = await client.listJobTemplates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobTemplates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobTemplates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobTemplates without error using callback', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + ]; + client.innerApiCalls.listJobTemplates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobTemplates( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.video.transcoder.v1.IJobTemplate[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobTemplates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobTemplates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobTemplates with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobTemplates = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listJobTemplates(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobTemplates as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobTemplates as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobTemplatesStream without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + ]; + client.descriptors.page.listJobTemplates.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.transcoder.v1.JobTemplate[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.video.transcoder.v1.JobTemplate) => { + 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.listJobTemplates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobTemplates, request) + ); + assert( + (client.descriptors.page.listJobTemplates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobTemplatesStream with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobTemplates.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.video.transcoder.v1.JobTemplate[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.video.transcoder.v1.JobTemplate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobTemplates.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobTemplates, request) + ); + assert( + (client.descriptors.page.listJobTemplates.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobTemplates without error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.JobTemplate() + ), + ]; + client.descriptors.page.listJobTemplates.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.video.transcoder.v1.IJobTemplate[] = + []; + const iterable = client.listJobTemplatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listJobTemplates.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listJobTemplates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobTemplates with error', async () => { + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.video.transcoder.v1.ListJobTemplatesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.video.transcoder.v1.ListJobTemplatesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobTemplates.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobTemplatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.video.transcoder.v1.IJobTemplate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listJobTemplates.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listJobTemplates.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('job', () => { + const fakePath = '/rendered/path/job'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + job: 'jobValue', + }; + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath( + 'projectValue', + 'locationValue', + 'jobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, 'jobValue'); + assert( + (client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('jobTemplate', () => { + const fakePath = '/rendered/path/jobTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + job_template: 'jobTemplateValue', + }; + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.jobTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('jobTemplatePath', () => { + const result = client.jobTemplatePath( + 'projectValue', + 'locationValue', + 'jobTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.jobTemplatePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromJobTemplateName', () => { + const result = client.matchProjectFromJobTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.jobTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromJobTemplateName', () => { + const result = client.matchLocationFromJobTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.jobTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchJobTemplateFromJobTemplateName', () => { + const result = client.matchJobTemplateFromJobTemplateName(fakePath); + assert.strictEqual(result, 'jobTemplateValue'); + assert( + (client.pathTemplates.jobTemplatePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new transcoderserviceModule.v1.TranscoderServiceClient({ + 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) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-video-transcoder/tsconfig.json b/packages/google-cloud-video-transcoder/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-video-transcoder/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-transcoder/webpack.config.js b/packages/google-cloud-video-transcoder/webpack.config.js new file mode 100644 index 00000000000..4b7a68a3237 --- /dev/null +++ b/packages/google-cloud-video-transcoder/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: 'TranscoderService', + filename: './transcoder-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', +};