diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f89a1514960..b35093bdd48 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -12,10 +12,12 @@ "packages/google-cloud-bigquery-datapolicies": "0.1.2", "packages/google-cloud-bigquery-datatransfer": "3.1.5", "packages/google-cloud-bigquery-reservation": "2.0.4", - "packages/google-cloud-gkeconnect-gateway": "2.0.5", - "packages/google-cloud-deploy": "2.2.2", - "packages/google-cloud-dataplex": "2.2.2", "packages/google-cloud-certificatemanager": "0.6.2", + "packages/google-cloud-contentwarehouse": "0.1.2", + "packages/google-cloud-dataplex": "2.2.2", + "packages/google-cloud-deploy": "2.2.2", + "packages/google-cloud-discoveryengine": "0.2.0", + "packages/google-cloud-gkeconnect-gateway": "2.0.5", "packages/google-cloud-gkemulticloud": "0.1.4", "packages/google-cloud-language": "5.1.2", "packages/google-cloud-memcache": "2.1.4", @@ -27,12 +29,11 @@ "packages/google-cloud-resourcemanager": "4.1.3", "packages/google-cloud-security-publicca": "0.1.3", "packages/google-cloud-shell": "2.0.4", + "packages/google-cloud-videointelligence": "4.1.1", "packages/google-devtools-artifactregistry": "2.0.2", "packages/google-iam": "0.2.2", + "packages/google-maps-addressvalidation": "0.1.0", "packages/google-maps-routing": "0.2.1", "packages/google-monitoring-dashboard": "2.8.0", - "packages/typeless-sample-bot": "1.1.0", - "packages/google-cloud-discoveryengine": "0.2.0", - "packages/google-cloud-contentwarehouse": "0.1.2", - "packages/google-maps-addressvalidation": "0.1.0" + "packages/typeless-sample-bot": "1.1.0" } diff --git a/packages/google-cloud-videointelligence/.OwlBot.yaml b/packages/google-cloud-videointelligence/.OwlBot.yaml new file mode 100644 index 00000000000..25c12805ff7 --- /dev/null +++ b/packages/google-cloud-videointelligence/.OwlBot.yaml @@ -0,0 +1,23 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/videointelligence/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-videointelligence/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-videointelligence/.eslintignore b/packages/google-cloud-videointelligence/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-videointelligence/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-videointelligence/.eslintrc.json b/packages/google-cloud-videointelligence/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-videointelligence/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-videointelligence/.gitattributes b/packages/google-cloud-videointelligence/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-videointelligence/.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-videointelligence/.gitignore b/packages/google-cloud-videointelligence/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-videointelligence/.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-videointelligence/.jsdoc.js b/packages/google-cloud-videointelligence/.jsdoc.js new file mode 100644 index 00000000000..6c816e680e9 --- /dev/null +++ b/packages/google-cloud-videointelligence/.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-intelligence', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-videointelligence/.mocharc.js b/packages/google-cloud-videointelligence/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-videointelligence/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-videointelligence/.nycrc b/packages/google-cloud-videointelligence/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-videointelligence/.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-videointelligence/.prettierignore b/packages/google-cloud-videointelligence/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-videointelligence/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-videointelligence/.prettierrc.js b/packages/google-cloud-videointelligence/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-videointelligence/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-videointelligence/.repo-metadata.json b/packages/google-cloud-videointelligence/.repo-metadata.json new file mode 100644 index 00000000000..67475fd6fc5 --- /dev/null +++ b/packages/google-cloud-videointelligence/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "name": "video", + "issue_tracker": "https://issuetracker.google.com/savedsearches/5084810", + "default_version": "v1", + "api_id": "videointelligence.googleapis.com", + "distribution_name": "@google-cloud/video-intelligence", + "requires_billing": true, + "product_documentation": "https://cloud.google.com/video-intelligence", + "codeowner_team": "@googleapis/ml-apis", + "name_pretty": "Google Cloud Video Intelligence", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/video-intelligence/latest", + "release_level": "stable", + "api_shortname": "videointelligence", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-videointelligence/CHANGELOG.md b/packages/google-cloud-videointelligence/CHANGELOG.md new file mode 100644 index 00000000000..0792cb3cab8 --- /dev/null +++ b/packages/google-cloud-videointelligence/CHANGELOG.md @@ -0,0 +1,462 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/video-intelligence?activeTab=versions + +## [4.1.1](https://github.com/googleapis/nodejs-video-intelligence/compare/v4.1.0...v4.1.1) (2022-11-08) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#761](https://github.com/googleapis/nodejs-video-intelligence/issues/761)) ([e068bd3](https://github.com/googleapis/nodejs-video-intelligence/commit/e068bd338e9750e39f029faaf4ff52a5d5ad7d32)) + +## [4.1.0](https://github.com/googleapis/nodejs-video-intelligence/compare/v4.0.0...v4.1.0) (2022-09-21) + + +### Features + +* Accept google-gax instance as a parameter ([#743](https://github.com/googleapis/nodejs-video-intelligence/issues/743)) ([293e571](https://github.com/googleapis/nodejs-video-intelligence/commit/293e5716344149040135a897dc46ca1b298c01b4)) + + +### Bug Fixes + +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-video-intelligence/issues/1553)) ([#747](https://github.com/googleapis/nodejs-video-intelligence/issues/747)) ([5fc9e71](https://github.com/googleapis/nodejs-video-intelligence/commit/5fc9e71daaef572b3b077cefd165eac1d2d97841)) + +## [4.0.0](https://github.com/googleapis/nodejs-video-intelligence/compare/v3.4.1...v4.0.0) (2022-06-29) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#714) +* field ObjectTrackingAnnotation.segment moved into oneof, added track_id (#704) + +### Features + +* field ObjectTrackingAnnotation.segment moved into oneof, added track_id ([#704](https://github.com/googleapis/nodejs-video-intelligence/issues/704)) ([b55757b](https://github.com/googleapis/nodejs-video-intelligence/commit/b55757bedbc2563f2304a6596c50104b499f73d5)) +* support regapic LRO ([#720](https://github.com/googleapis/nodejs-video-intelligence/issues/720)) ([903e5ca](https://github.com/googleapis/nodejs-video-intelligence/commit/903e5cad702bfcaab49ed141fe503ff0d22c3b83)) + + +### Bug Fixes + +* fixes for dynamic routing and streaming descriptors ([#716](https://github.com/googleapis/nodejs-video-intelligence/issues/716)) ([853d91e](https://github.com/googleapis/nodejs-video-intelligence/commit/853d91e57929323e18ac599e52d436f0f5c3288c)) + + +### Build System + +* update library to use Node 12 ([#714](https://github.com/googleapis/nodejs-video-intelligence/issues/714)) ([a9fbbcd](https://github.com/googleapis/nodejs-video-intelligence/commit/a9fbbcd7ab5f7cc49026b3a39b89512ba21c481c)) + +### [3.4.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.4.0...v3.4.1) (2021-09-15) + + +### Bug Fixes + +* **deps:** require google-gax v2.24.1 ([#589](https://www.github.com/googleapis/nodejs-video-intelligence/issues/589)) ([6af1a84](https://www.github.com/googleapis/nodejs-video-intelligence/commit/6af1a84112ab56a3ff2862ff7a5eda0da9772244)) + +## [3.4.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.6...v3.4.0) (2021-09-15) + + +### Features + +* turns on self-signed JWT feature flag ([#608](https://www.github.com/googleapis/nodejs-video-intelligence/issues/608)) ([a08a54b](https://www.github.com/googleapis/nodejs-video-intelligence/commit/a08a54b3c49464ca5b8df8ba924d244ab61665ba)) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#613](https://www.github.com/googleapis/nodejs-video-intelligence/issues/613)) ([68e079f](https://www.github.com/googleapis/nodejs-video-intelligence/commit/68e079f1d985d60576342663a2008d316502e205)) + +### [3.3.6](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.5...v3.3.6) (2021-07-21) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#577](https://www.github.com/googleapis/nodejs-video-intelligence/issues/577)) ([53ba013](https://www.github.com/googleapis/nodejs-video-intelligence/commit/53ba01323adff17801b05c4d976368a691bc9f4b)) +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#579](https://www.github.com/googleapis/nodejs-video-intelligence/issues/579)) ([46cfd26](https://www.github.com/googleapis/nodejs-video-intelligence/commit/46cfd265981b58b04dcc26960a9f0961c424cd92)) + +### [3.3.5](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.4...v3.3.5) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#573](https://www.github.com/googleapis/nodejs-video-intelligence/issues/573)) ([afb19b5](https://www.github.com/googleapis/nodejs-video-intelligence/commit/afb19b5d54518d672e761881110c69e78276f80c)) + +### [3.3.4](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.3...v3.3.4) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#566](https://www.github.com/googleapis/nodejs-video-intelligence/issues/566)) ([ef7abca](https://www.github.com/googleapis/nodejs-video-intelligence/commit/ef7abca3d3d7ba44f0fc8406ebef4a5396147bc4)) + +### [3.3.3](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.2...v3.3.3) (2021-06-10) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#556](https://www.github.com/googleapis/nodejs-video-intelligence/issues/556)) ([be3a053](https://www.github.com/googleapis/nodejs-video-intelligence/commit/be3a053818f7b59825f777460e129a10ada7fd79)) +* remove doc config exception ([#553](https://www.github.com/googleapis/nodejs-video-intelligence/issues/553)) ([39d0f04](https://www.github.com/googleapis/nodejs-video-intelligence/commit/39d0f04a9f37e649dae5a2ad559d21db99665bdf)) + +### [3.3.2](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.1...v3.3.2) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#544](https://www.github.com/googleapis/nodejs-video-intelligence/issues/544)) ([da8698f](https://www.github.com/googleapis/nodejs-video-intelligence/commit/da8698f4ce5b8853da2d66597efa204f8dd476b0)) +* use require() to load JSON protos ([#548](https://www.github.com/googleapis/nodejs-video-intelligence/issues/548)) ([589b3bb](https://www.github.com/googleapis/nodejs-video-intelligence/commit/589b3bb4fc1efe7dfc382ee3d49354e1b92dc044)) + +### [3.3.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.0...v3.3.1) (2021-04-19) + + +### Bug Fixes + +* update region tag from v1beta1 to v1 for analyze-face-detection.js ([#530](https://www.github.com/googleapis/nodejs-video-intelligence/issues/530)) ([4d19f9d](https://www.github.com/googleapis/nodejs-video-intelligence/commit/4d19f9de9e386ee92ed18d9302cddc61c2dc9865)) + +## [3.3.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.2.0...v3.3.0) (2021-01-09) + + +### Features + +* introduce tracks and thumbnails fields for FaceDetectionAnnotation ([#508](https://www.github.com/googleapis/nodejs-video-intelligence/issues/508)) ([9bfff4b](https://www.github.com/googleapis/nodejs-video-intelligence/commit/9bfff4b941e9d52cd8c7051e8fba66a6256b854a)) + +## [3.2.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.1.2...v3.2.0) (2020-12-08) + + +### Features + +* person detection samples to GA ([#504](https://www.github.com/googleapis/nodejs-video-intelligence/issues/504)) ([eec2a65](https://www.github.com/googleapis/nodejs-video-intelligence/commit/eec2a653aa635716c2d455152867ea2eef10d284)) + +### [3.1.2](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.1.1...v3.1.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([#501](https://www.github.com/googleapis/nodejs-video-intelligence/issues/501)) ([2d3aa08](https://www.github.com/googleapis/nodejs-video-intelligence/commit/2d3aa086d02e3ee0f238c4d81daeefbe2b355c11)) + +### [3.1.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.1.0...v3.1.1) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#493](https://www.github.com/googleapis/nodejs-video-intelligence/issues/493)) ([10886ef](https://www.github.com/googleapis/nodejs-video-intelligence/commit/10886efd1287c37e97788f9c377427caa6c7ea22)) + +## [3.1.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.0.1...v3.1.0) (2020-10-29) + + +### Features + +* GA launch for PersonDetection and FaceDetection features ([#482](https://www.github.com/googleapis/nodejs-video-intelligence/issues/482)) ([6994bb0](https://www.github.com/googleapis/nodejs-video-intelligence/commit/6994bb0070b25a69a1ba8c47896cb7e5e18a30d9)) + +### [3.0.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.0.0...v3.0.1) (2020-06-29) + + +### Bug Fixes + +* handle fallback option properly ([#447](https://www.github.com/googleapis/nodejs-video-intelligence/issues/447)) ([f539818](https://www.github.com/googleapis/nodejs-video-intelligence/commit/f53981853598015e24900116e8ca9b2d18670336)) +* update node issue template ([#449](https://www.github.com/googleapis/nodejs-video-intelligence/issues/449)) ([b3fa3ef](https://www.github.com/googleapis/nodejs-video-intelligence/commit/b3fa3ef1e6648379495d5c94e8dea184b8fcec4d)) + +## [3.0.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.10.0...v3.0.0) (2020-06-02) + + +### ⚠ BREAKING CHANGES + +* synth.py clean up for multiple version (#436) +* drop node8, remove eslint, update gax, fix generated protos, run the generator (#423) + +### Features + +* check status of long running operation by its name ([#435](https://www.github.com/googleapis/nodejs-video-intelligence/issues/435)) ([be4793e](https://www.github.com/googleapis/nodejs-video-intelligence/commit/be4793ebf71ce03c4855b9d3a29037070d11025e)) +* drop node8, remove eslint, update gax, fix generated protos, run the generator ([#423](https://www.github.com/googleapis/nodejs-video-intelligence/issues/423)) ([d13bb42](https://www.github.com/googleapis/nodejs-video-intelligence/commit/d13bb4268f3cc6a1c58e3d53cece92db26df4ef2)) +* logo recognition update to GA ([7f02d63](https://www.github.com/googleapis/nodejs-video-intelligence/commit/7f02d6315771b37e4ad473f16a955c4c845b1a83)) +* **v1p3beta1:** added support for streaming automl action recognition. ([#439](https://www.github.com/googleapis/nodejs-video-intelligence/issues/439)) ([2d5809d](https://www.github.com/googleapis/nodejs-video-intelligence/commit/2d5809df5293114a20752317dcf34dd2b86629e0)) + + +### Bug Fixes + +* synth.py clean up for multiple version ([#436](https://www.github.com/googleapis/nodejs-video-intelligence/issues/436)) ([fc4d36c](https://www.github.com/googleapis/nodejs-video-intelligence/commit/fc4d36c4d112ed75d5c38dd6cad76073e9234253)) + +## [2.10.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.9.0...v2.10.0) (2020-03-18) + + +### Features + +* expose logo recognition API proto for GA ([#402](https://www.github.com/googleapis/nodejs-video-intelligence/issues/402)) ([5812129](https://www.github.com/googleapis/nodejs-video-intelligence/commit/5812129d86ed8b0ba152c196849986362617969d)) + +## [2.9.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.8.0...v2.9.0) (2020-03-11) + + +### Features + +* deferred client initialization ([#389](https://www.github.com/googleapis/nodejs-video-intelligence/issues/389)) ([fdbb623](https://www.github.com/googleapis/nodejs-video-intelligence/commit/fdbb62308f628dabf84f0a3cd7728bbe0f26a0fd)) + +## [2.8.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.7.0...v2.8.0) (2020-03-09) + + +### Features + +* typescript conversion on video-intelligence ([#375](https://www.github.com/googleapis/nodejs-video-intelligence/issues/375)) ([30b01d5](https://www.github.com/googleapis/nodejs-video-intelligence/commit/30b01d5b2e5eae2c26591f916255ee4f09ea5dff)) + +## [2.7.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.6.5...v2.7.0) (2020-02-13) + + +### Features + +* face and person detection samples ([#362](https://www.github.com/googleapis/nodejs-video-intelligence/issues/362)) ([cff2f36](https://www.github.com/googleapis/nodejs-video-intelligence/commit/cff2f36a4e6294908a4e26587ed840c1ec1b03f8)) + + +### Bug Fixes + +* adds spaces to region tags, other fixes ([#369](https://www.github.com/googleapis/nodejs-video-intelligence/issues/369)) ([2b6943e](https://www.github.com/googleapis/nodejs-video-intelligence/commit/2b6943ee0685761a0076c7b8023eed4f12f93d64)) +* fixes face and people detection region tags ([#367](https://www.github.com/googleapis/nodejs-video-intelligence/issues/367)) ([ab039b5](https://www.github.com/googleapis/nodejs-video-intelligence/commit/ab039b56b3bea27edf93c4db7c97241599d38419)) +* refactors person and face detection samples into separate files ([#370](https://www.github.com/googleapis/nodejs-video-intelligence/issues/370)) ([eb9b400](https://www.github.com/googleapis/nodejs-video-intelligence/commit/eb9b400c24bdf306d8263ec402922b3235754034)) +* updates README file with correct links ([#371](https://www.github.com/googleapis/nodejs-video-intelligence/issues/371)) ([fb2701a](https://www.github.com/googleapis/nodejs-video-intelligence/commit/fb2701a81c7476ef06ab279a8d4572f006abe831)) + +### [2.6.5](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.6.4...v2.6.5) (2020-01-29) + + +### Bug Fixes + +* new proto annotations; .d.ts enums support strings ([#358](https://www.github.com/googleapis/nodejs-video-intelligence/issues/358)) ([fabc337](https://www.github.com/googleapis/nodejs-video-intelligence/commit/fabc337168c70a7cead33e6b782a408d691149b1)) + +### [2.6.4](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.6.3...v2.6.4) (2020-01-06) + + +### Bug Fixes + +* no need to have smoke test here ([4922079](https://www.github.com/googleapis/nodejs-video-intelligence/commit/49220790cd78a3079efbb0705472dd52f59f04ff)) + +### [2.6.3](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.6.2...v2.6.3) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([b4ef100](https://www.github.com/googleapis/nodejs-video-intelligence/commit/b4ef100ab0bebc2beb80234d93f3a3b8905079d9)) + +### [2.6.2](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.6.1...v2.6.2) (2019-11-18) + + +### Bug Fixes + +* **deps:** update dependency yargs to v15 ([#326](https://www.github.com/googleapis/nodejs-video-intelligence/issues/326)) ([849ea31](https://www.github.com/googleapis/nodejs-video-intelligence/commit/849ea311dcf3987ac823683c209cf9aad917e468)) + +### [2.6.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.6.0...v2.6.1) (2019-11-14) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#320](https://www.github.com/googleapis/nodejs-video-intelligence/issues/320)) ([db2a759](https://www.github.com/googleapis/nodejs-video-intelligence/commit/db2a759cadf4a554b1287b30776445237f4332b7)) +* import long into proto ts declaration file ([#321](https://www.github.com/googleapis/nodejs-video-intelligence/issues/321)) ([adbe31e](https://www.github.com/googleapis/nodejs-video-intelligence/commit/adbe31e503edc6c1031a7ca03fb3a4fd5d78b090)) + +## [2.6.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.5.2...v2.6.0) (2019-11-07) + + +### Features + +* support celebrity recognition ([#316](https://www.github.com/googleapis/nodejs-video-intelligence/issues/316)) ([a7235d3](https://www.github.com/googleapis/nodejs-video-intelligence/commit/a7235d301fe55936e06e7daa27daeeae341a22c2)) + +### [2.5.2](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.5.1...v2.5.2) (2019-10-29) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#309](https://www.github.com/googleapis/nodejs-video-intelligence/issues/309)) ([deb8d2f](https://www.github.com/googleapis/nodejs-video-intelligence/commit/deb8d2fef29b949cbe76d76b88e0b26852a0c0d8)) +* **tests:** use alternate video for integration tests ([#311](https://www.github.com/googleapis/nodejs-video-intelligence/issues/311)) ([7cf9042](https://www.github.com/googleapis/nodejs-video-intelligence/commit/7cf9042b4051c84a10537061b24757f2fc0c4f66)) + +### [2.5.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.5.0...v2.5.1) (2019-10-12) + + +### Bug Fixes + +* update retry logic and remove unused protos ([#307](https://www.github.com/googleapis/nodejs-video-intelligence/issues/307)) ([c42afbc](https://www.github.com/googleapis/nodejs-video-intelligence/commit/c42afbc327958f515ad5589ed03271490fd3b4fc)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.4.0...v2.5.0) (2019-10-11) + + +### Features + +* remove v1beta1 API support ([d8ffe44](https://www.github.com/googleapis/nodejs-video-intelligence/commit/d8ffe443ec7a967c4fef802b0b32b7c3a616f23d)) + + +### Bug Fixes + +* remove tests for the removed API ([#306](https://www.github.com/googleapis/nodejs-video-intelligence/issues/306)) ([4d2792c](https://www.github.com/googleapis/nodejs-video-intelligence/commit/4d2792ca820b64aee4803cd3c34163ea3294739f)) +* use compatible version of google-gax ([82f7021](https://www.github.com/googleapis/nodejs-video-intelligence/commit/82f70216edc7e022f2d5c0589bcd7aee9b2293e9)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.3.0...v2.4.0) (2019-09-30) + + +### Features + +* .d.ts for protos ([#293](https://www.github.com/googleapis/nodejs-video-intelligence/issues/293)) ([c49a0fb](https://www.github.com/googleapis/nodejs-video-intelligence/commit/c49a0fb)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.2.2...v2.3.0) (2019-09-16) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([0a1363c](https://www.github.com/googleapis/nodejs-video-intelligence/commit/0a1363c)) +* fixed typo enableAutomaticPunctuation2 in sample ([3188368](https://www.github.com/googleapis/nodejs-video-intelligence/commit/3188368)) + + +### Features + +* add streaming automl classification samples ([#284](https://www.github.com/googleapis/nodejs-video-intelligence/issues/284)) ([7bb53d5](https://www.github.com/googleapis/nodejs-video-intelligence/commit/7bb53d5)) +* load protos from JSON, grpc-fallback support ([#286](https://www.github.com/googleapis/nodejs-video-intelligence/issues/286)) ([a1c2898](https://www.github.com/googleapis/nodejs-video-intelligence/commit/a1c2898)) +* segment and shot label annotations support ([#281](https://www.github.com/googleapis/nodejs-video-intelligence/issues/281)) ([1787c6a](https://www.github.com/googleapis/nodejs-video-intelligence/commit/1787c6a)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.2.1...v2.2.2) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([8fb7221](https://www.github.com/googleapis/nodejs-video-intelligence/commit/8fb7221)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.2.0...v2.2.1) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#266](https://www.github.com/googleapis/nodejs-video-intelligence/issues/266)) ([f992de6](https://www.github.com/googleapis/nodejs-video-intelligence/commit/f992de6)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.1.2...v2.2.0) (2019-06-20) + + +### Features + +* support streaming automl configs ([#261](https://www.github.com/googleapis/nodejs-video-intelligence/issues/261)) ([ca3e0d3](https://www.github.com/googleapis/nodejs-video-intelligence/commit/ca3e0d3)) + +### [2.1.2](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.1.1...v2.1.2) (2019-06-13) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#257](https://www.github.com/googleapis/nodejs-video-intelligence/issues/257)) ([fccfb8d](https://www.github.com/googleapis/nodejs-video-intelligence/commit/fccfb8d)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.1.0...v2.1.1) (2019-06-10) + + +### Bug Fixes + +* Update example commands to use cloud-storage-samples bucket ([#253](https://www.github.com/googleapis/nodejs-video-intelligence/issues/253)) ([3a80413](https://www.github.com/googleapis/nodejs-video-intelligence/commit/3a80413)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.0.1...v2.1.0) (2019-06-05) + + +### Features + +* add ObjectTrackingConfig and support apiEndpoint ([#249](https://www.github.com/googleapis/nodejs-video-intelligence/issues/249)) ([bac9326](https://www.github.com/googleapis/nodejs-video-intelligence/commit/bac9326)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v2.0.0...v2.0.1) (2019-05-20) + + +### Bug Fixes + +* update min dependencies and use repo-tools to generate README ([#236](https://www.github.com/googleapis/nodejs-video-intelligence/issues/236)) ([81dfa09](https://www.github.com/googleapis/nodejs-video-intelligence/commit/81dfa09)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v1.6.0...v2.0.0) (2019-05-13) + + +### Bug Fixes + +* DEADLINE_EXCEEDED retry code is idempotent ([#234](https://www.github.com/googleapis/nodejs-video-intelligence/issues/234)) ([7a98ca6](https://www.github.com/googleapis/nodejs-video-intelligence/commit/7a98ca6)) +* **deps:** update dependency google-gax to v1 ([#233](https://www.github.com/googleapis/nodejs-video-intelligence/issues/233)) ([0ad08b2](https://www.github.com/googleapis/nodejs-video-intelligence/commit/0ad08b2)) +* DEADLINE_EXCEEDED no longer treated as idempotent and retried ([#228](https://www.github.com/googleapis/nodejs-video-intelligence/issues/228)) ([c25517e](https://www.github.com/googleapis/nodejs-video-intelligence/commit/c25517e)) +* **deps:** update dependency google-gax to ^0.26.0 ([#222](https://www.github.com/googleapis/nodejs-video-intelligence/issues/222)) ([22de82b](https://www.github.com/googleapis/nodejs-video-intelligence/commit/22de82b)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#223](https://www.github.com/googleapis/nodejs-video-intelligence/issues/223)) ([966eef9](https://www.github.com/googleapis/nodejs-video-intelligence/commit/966eef9)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#223) + +## v1.6.0 + +02-21-2019 13:46 PST + +### Implementation Changes +- fix: throw on invalid credentials + +### New Features +- feat: generate v1p3beta1 with streaming support ([#198](https://github.com/googleapis/nodejs-video-intelligence/pull/198)) +- feat: add text detection and object mapping support ([#197](https://github.com/googleapis/nodejs-video-intelligence/pull/197)) + +### Dependencies +- chore(deps): update dependency mocha to v6 +- fix(deps): update dependency yargs to v13 ([#192](https://github.com/googleapis/nodejs-video-intelligence/pull/192)) + +### Documentation +- docs: update links in contrib guide ([#195](https://github.com/googleapis/nodejs-video-intelligence/pull/195)) +- build: create docs test npm scripts ([#191](https://github.com/googleapis/nodejs-video-intelligence/pull/191)) +- docs: update contributing path in README ([#189](https://github.com/googleapis/nodejs-video-intelligence/pull/189)) + +### Internal / Testing Changes +- build: use linkinator for docs test ([#194](https://github.com/googleapis/nodejs-video-intelligence/pull/194)) +- build: test using @grpc/grpc-js in CI ([#190](https://github.com/googleapis/nodejs-video-intelligence/pull/190)) +- chore: move CONTRIBUTING.md to root ([#188](https://github.com/googleapis/nodejs-video-intelligence/pull/188)) + +## v1.5.1 + +02-05-2019 15:05 PST + +### Fixes +- fix: increase gRPC timeout window ([#139](https://github.com/googleapis/nodejs-video-intelligence/pull/139)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#183](https://github.com/googleapis/nodejs-video-intelligence/pull/183)) +- refactor: remove unused deps and fix lint ([#141](https://github.com/googleapis/nodejs-video-intelligence/pull/141)) + +### Documentation +- docs: add lint/fix example to contributing guide ([#185](https://github.com/googleapis/nodejs-video-intelligence/pull/185)) +- docs: remove unused long running operation message typesed to pick up changes in the API or client library generator. ([#176](https://github.com/googleapis/nodejs-video-intelligence/pull/176)) +- docs: fix filepath of example command in README ([#160](https://github.com/googleapis/nodejs-video-intelligence/pull/160)) +- docs: fix typo in samples/analyze.js ([#159](https://github.com/googleapis/nodejs-video-intelligence/pull/159)) +- docs: update readme badges ([#156](https://github.com/googleapis/nodejs-video-intelligence/pull/156)) +- docs(samples): update samples to use GA APIs ([#153](https://github.com/googleapis/nodejs-video-intelligence/pull/153)) +- docs(samples): updated samples code to use async await ([#151](https://github.com/googleapis/nodejs-video-intelligence/pull/151)) + +## v1.5.0 + +### New features +- feat: add speech transcription + +### Documentation +- docs(samples): video beta samples ([#123](https://github.com/googleapis/nodejs-video-intelligence/pull/123)) + +### Internal / Testing Changes +- chore: update issue templates ([#128](https://github.com/googleapis/nodejs-video-intelligence/pull/128)) +- chore: remove old issue template ([#124](https://github.com/googleapis/nodejs-video-intelligence/pull/124)) +- build: run tests on node11 ([#122](https://github.com/googleapis/nodejs-video-intelligence/pull/122)) +- chores(build): do not collect sponge.xml from windows builds ([#121](https://github.com/googleapis/nodejs-video-intelligence/pull/121)) +- chores(build): run codecov on continuous builds ([#120](https://github.com/googleapis/nodejs-video-intelligence/pull/120)) +- chore: update new issue template ([#119](https://github.com/googleapis/nodejs-video-intelligence/pull/119)) + +## v1.4.1 + +### Implementation Changes +- chore: minor generator changes ([#110](https://github.com/googleapis/nodejs-video-intelligence/pull/110)) + +### Internal / Testing Changes +- build: fix codecov uploading on Kokoro ([#112](https://github.com/googleapis/nodejs-video-intelligence/pull/112)) +- Update kokoro config ([#109](https://github.com/googleapis/nodejs-video-intelligence/pull/109)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#108](https://github.com/googleapis/nodejs-video-intelligence/pull/108)) +- Update CI config ([#105](https://github.com/googleapis/nodejs-video-intelligence/pull/105)) +- test: remove appveyor config ([#106](https://github.com/googleapis/nodejs-video-intelligence/pull/106)) +- Enable prefer-const in the eslint config ([#102](https://github.com/googleapis/nodejs-video-intelligence/pull/102)) +- Enable no-var in eslint ([#101](https://github.com/googleapis/nodejs-video-intelligence/pull/101)) + +## v1.4.0 + +### New Features +- feat: release v1p2beta1 client (Object tracking and Text detecting beta) ([#98](https://github.com/googleapis/nodejs-video-intelligence/pull/98)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.20.0 ([#96](https://github.com/googleapis/nodejs-video-intelligence/pull/96)) + +### Internal / Testing Changes +- Switch to let/const ([#97](https://github.com/googleapis/nodejs-video-intelligence/pull/97)) +- test: throw on deprecation ([#72](https://github.com/googleapis/nodejs-video-intelligence/pull/72)) +- Update CI config ([#95](https://github.com/googleapis/nodejs-video-intelligence/pull/95)) +- Retry npm install in CI ([#93](https://github.com/googleapis/nodejs-video-intelligence/pull/93)) +- add templates to synth.py ([#91](https://github.com/googleapis/nodejs-video-intelligence/pull/91)) diff --git a/packages/google-cloud-videointelligence/CODE_OF_CONDUCT.md b/packages/google-cloud-videointelligence/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-videointelligence/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-videointelligence/CONTRIBUTING.md b/packages/google-cloud-videointelligence/CONTRIBUTING.md new file mode 100644 index 00000000000..4a96ee30466 --- /dev/null +++ b/packages/google-cloud-videointelligence/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Video Intelligence 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=videointelligence.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/LICENSE b/packages/google-cloud-videointelligence/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-videointelligence/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-videointelligence/README.md b/packages/google-cloud-videointelligence/README.md new file mode 100644 index 00000000000..c6c99f78390 --- /dev/null +++ b/packages/google-cloud-videointelligence/README.md @@ -0,0 +1,191 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Video Intelligence: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/video-intelligence.svg)](https://www.npmjs.org/package/@google-cloud/video-intelligence) + + + + +Google Cloud Video Intelligence API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-videointelligence/CHANGELOG.md). + +* [Google Cloud Video Intelligence Node.js Client API Reference][client-docs] +* [Google Cloud Video Intelligence Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-videointelligence](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-videointelligence) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Video Intelligence 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-intelligence +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud Video Intelligence library +const videoIntelligence = require('@google-cloud/video-intelligence'); + +// Creates a client +const client = new videoIntelligence.VideoIntelligenceServiceClient(); + +// The GCS uri of the video to analyze +const gcsUri = 'gs://cloud-samples-data/video/cat.mp4'; + +// Construct request +const request = { + inputUri: gcsUri, + features: ['LABEL_DETECTION'], +}; + +// Execute request +const [operation] = await client.annotateVideo(request); + +console.log( + 'Waiting for operation to complete... (this may take a few minutes)' +); + +const [operationResult] = await operation.promise(); + +// Gets annotations for video +const annotations = operationResult.annotationResults[0]; + +// Gets labels for video from its annotations +const labels = annotations.segmentLabelAnnotations; +labels.forEach(label => { + console.log(`Label ${label.entity.description} occurs at:`); + label.segments.forEach(segment => { + segment = segment.segment; + console.log( + `\tStart: ${segment.startTimeOffset.seconds}` + + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` + ); + console.log( + `\tEnd: ${segment.endTimeOffset.seconds}.` + + `${(segment.endTimeOffset.nanos / 1e6).toFixed(0)}s` + ); + }); +}); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js,samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js,samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js,samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js,samples/README.md) | +| Streaming_video_intelligence_service.streaming_annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js,samples/README.md) | +| Video_intelligence_service.annotate_video | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/test/quickstart.test.js,samples/README.md) | + + + +The [Google Cloud Video Intelligence 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-intelligence@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/video-intelligence/latest +[product-docs]: https://cloud.google.com/video-intelligence +[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=videointelligence.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-videointelligence/linkinator.config.json b/packages/google-cloud-videointelligence/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-videointelligence/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-videointelligence/package.json b/packages/google-cloud-videointelligence/package.json new file mode 100644 index 00000000000..df4b5cee22c --- /dev/null +++ b/packages/google-cloud-videointelligence/package.json @@ -0,0 +1,73 @@ +{ + "name": "@google-cloud/video-intelligence", + "description": "Google Cloud Video Intelligence API client for Node.js", + "version": "4.1.1", + "license": "Apache-2.0", + "author": "Google Inc", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "directory": "packages/google-cloud-videointelligence", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src", + "LICENSE" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google video intelligence", + "video intelligence", + "Google Cloud Video Intelligence API" + ], + "scripts": { + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "fix": "gts fix", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "prelint": "cd samples; npm link ../; npm install", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "eslint-plugin-node": "^11.1.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", + "prettier": "^2.1.2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-videointelligence" +} diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1/video_intelligence.proto new file mode 100644 index 00000000000..648ec475253 --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1/video_intelligence.proto @@ -0,0 +1,906 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.videointelligence.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1"; +option ruby_package = "Google::Cloud::VideoIntelligence::V1"; + +// Service that implements the Video Intelligence API. +service VideoIntelligenceService { + option (google.api.default_host) = "videointelligence.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/videos:annotate" + body: "*" + }; + option (google.api.method_signature) = "input_uri,features"; + option (google.longrunning.operation_info) = { + response_type: "AnnotateVideoResponse" + metadata_type: "AnnotateVideoProgress" + }; + } +} + +// Video annotation request. +message AnnotateVideoRequest { + // Input video location. Currently, only + // [Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported. URIs must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + // multiple videos, a video URI may include wildcards in the `object-id`. + // Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` must be unset. + string input_uri = 1; + + // The video data bytes. + // If unset, the input video(s) should be specified via the `input_uri`. + // If set, `input_uri` must be unset. + bytes input_content = 6; + + // Required. Requested video annotation features. + repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // Optional. Location where the output (in JSON format) should be stored. + // Currently, only [Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported. These must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). + string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud region where annotation should take place. Supported cloud + // regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + // region is specified, the region will be determined based on video file + // location. + string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video is + // treated as a single segment. + repeated VideoSegment segments = 1; + + // Config for LABEL_DETECTION. + LabelDetectionConfig label_detection_config = 2; + + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig shot_change_detection_config = 3; + + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig explicit_content_detection_config = 4; + + // Config for FACE_DETECTION. + FaceDetectionConfig face_detection_config = 5; + + // Config for SPEECH_TRANSCRIPTION. + SpeechTranscriptionConfig speech_transcription_config = 6; + + // Config for TEXT_DETECTION. + TextDetectionConfig text_detection_config = 8; + + // Config for PERSON_DETECTION. + PersonDetectionConfig person_detection_config = 11; + + // Config for OBJECT_TRACKING. + ObjectTrackingConfig object_tracking_config = 13; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + EXPLICIT_CONTENT_DETECTION = 3; + + // Human face detection. + FACE_DETECTION = 4; + + // Speech transcription. + SPEECH_TRANSCRIPTION = 6; + + // OCR text detection and tracking. + TEXT_DETECTION = 7; + + // Object detection and tracking. + OBJECT_TRACKING = 9; + + // Logo detection, tracking, and recognition. + LOGO_RECOGNITION = 12; + + // Person detection. + PERSON_DETECTION = 14; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unspecified likelihood. + LIKELIHOOD_UNSPECIFIED = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} + +// Config for LABEL_DETECTION. +message LabelDetectionConfig { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 1; + + // Whether the video has been shot from a stationary (i.e., non-moving) + // camera. When set to true, might improve detection accuracy for moving + // objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + bool stationary_camera = 2; + + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; + + // The confidence threshold we perform filtering on the labels from + // frame-level detection. If not set, it is set to 0.4 by default. The valid + // range for this threshold is [0.1, 0.9]. Any value set outside of this + // range will be clipped. + // Note: For best results, follow the default threshold. We will update + // the default threshold everytime when we release a new model. + float frame_confidence_threshold = 4; + + // The confidence threshold we perform filtering on the labels from + // video-level and shot-level detections. If not set, it's set to 0.3 by + // default. The valid range for this threshold is [0.1, 0.9]. Any value set + // outside of this range will be clipped. + // Note: For best results, follow the default threshold. We will update + // the default threshold everytime when we release a new model. + float video_confidence_threshold = 5; +} + +// Config for SHOT_CHANGE_DETECTION. +message ShotChangeDetectionConfig { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for OBJECT_TRACKING. +message ObjectTrackingConfig { + // Model to use for object tracking. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for FACE_DETECTION. +message FaceDetectionConfig { + // Model to use for face detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; + + // Whether bounding boxes are included in the face annotation output. + bool include_bounding_boxes = 2; + + // Whether to enable face attributes detection, such as glasses, dark_glasses, + // mouth_open etc. Ignored if 'include_bounding_boxes' is set to false. + bool include_attributes = 5; +} + +// Config for PERSON_DETECTION. +message PersonDetectionConfig { + // Whether bounding boxes are included in the person detection annotation + // output. + bool include_bounding_boxes = 1; + + // Whether to enable pose landmarks detection. Ignored if + // 'include_bounding_boxes' is set to false. + bool include_pose_landmarks = 2; + + // Whether to enable person attributes detection, such as cloth color (black, + // blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, + // etc. + // Ignored if 'include_bounding_boxes' is set to false. + bool include_attributes = 3; +} + +// Config for EXPLICIT_CONTENT_DETECTION. +message ExplicitContentDetectionConfig { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for TEXT_DETECTION. +message TextDetectionConfig { + // Language hint can be specified if the language to be detected is known a + // priori. It can increase the accuracy of the detection. Language hint must + // be language code in BCP-47 format. + // + // Automatic language detection is performed if no hint is provided. + repeated string language_hints = 1; + + // Model to use for text detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 2; +} + +// Video segment. +message VideoSegment { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + google.protobuf.Duration start_time_offset = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + google.protobuf.Duration end_time_offset = 2; +} + +// Video segment level annotation results for label detection. +message LabelSegment { + // Video segment where a label was detected. + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Video frame level annotation results for label detection. +message LabelFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Detected entity from video analysis. +message Entity { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string entity_id = 1; + + // Textual description, e.g., `Fixed-gear bicycle`. + string description = 2; + + // Language code for `description` in BCP-47 format. + string language_code = 3; +} + +// Label annotation. +message LabelAnnotation { + // Detected entity. + Entity entity = 1; + + // Common categories for the detected entity. + // For example, when the label is `Terrier`, the category is likely `dog`. And + // in some cases there might be more than one categories e.g., `Terrier` could + // also be a `pet`. + repeated Entity category_entities = 2; + + // All video segments where a label was detected. + repeated LabelSegment segments = 3; + + // All video frames where a label was detected. + repeated LabelFrame frames = 4; + + // Feature version. + string version = 5; +} + +// Video frame level annotation results for explicit content. +message ExplicitContentFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Likelihood of the pornography content.. + Likelihood pornography_likelihood = 2; +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +message ExplicitContentAnnotation { + // All video frames where explicit content was detected. + repeated ExplicitContentFrame frames = 1; + + // Feature version. + string version = 2; +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +message NormalizedBoundingBox { + // Left X coordinate. + float left = 1; + + // Top Y coordinate. + float top = 2; + + // Right X coordinate. + float right = 3; + + // Bottom Y coordinate. + float bottom = 4; +} + +// Face detection annotation. +message FaceDetectionAnnotation { + // The face tracks with attributes. + repeated Track tracks = 3; + + // The thumbnail of a person's face. + bytes thumbnail = 4; + + // Feature version. + string version = 5; +} + +// Person detection annotation per video. +message PersonDetectionAnnotation { + // The detected tracks of a person. + repeated Track tracks = 1; + + // Feature version. + string version = 2; +} + +// Video segment level annotation results for face detection. +message FaceSegment { + // Video segment where a face was detected. + VideoSegment segment = 1; +} + +// Deprecated. No effect. +message FaceFrame { + option deprecated = true; + + // Normalized Bounding boxes in a frame. + // There can be more than one boxes if the same face is detected in multiple + // locations within the current frame. + repeated NormalizedBoundingBox normalized_bounding_boxes = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the video frame for this location. + google.protobuf.Duration time_offset = 2; +} + +// Deprecated. No effect. +message FaceAnnotation { + option deprecated = true; + + // Thumbnail of a representative face view (in JPEG format). + bytes thumbnail = 1; + + // All video segments where a face was detected. + repeated FaceSegment segments = 2; + + // All video frames where a face was detected. + repeated FaceFrame frames = 3; +} + +// For tracking related features. +// An object at time_offset with attributes, and located with +// normalized_bounding_box. +message TimestampedObject { + // Normalized Bounding box in a frame, where the object is located. + NormalizedBoundingBox normalized_bounding_box = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the video frame for this object. + google.protobuf.Duration time_offset = 2; + + // Optional. The attributes of the object in the bounding box. + repeated DetectedAttribute attributes = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The detected landmarks. + repeated DetectedLandmark landmarks = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A track of an object instance. +message Track { + // Video segment of a track. + VideoSegment segment = 1; + + // The object with timestamp and attributes per frame in the track. + repeated TimestampedObject timestamped_objects = 2; + + // Optional. Attributes in the track level. + repeated DetectedAttribute attributes = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The confidence score of the tracked object. + float confidence = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A generic detected attribute represented by name in string format. +message DetectedAttribute { + // The name of the attribute, for example, glasses, dark_glasses, mouth_open. + // A full list of supported type names will be provided in the document. + string name = 1; + + // Detected attribute confidence. Range [0, 1]. + float confidence = 2; + + // Text value of the detection result. For example, the value for "HairColor" + // can be "black", "blonde", etc. + string value = 3; +} + +// A generic detected landmark represented by name in string format and a 2D +// location. +message DetectedLandmark { + // The name of this landmark, for example, left_hand, right_shoulder. + string name = 1; + + // The 2D point of the detected landmark using the normalized image + // coordindate system. The normalized coordinates have the range from 0 to 1. + NormalizedVertex point = 2; + + // The confidence score of the detected landmark. Range [0, 1]. + float confidence = 3; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Video file location in + // [Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Video segment on which the annotation is run. + VideoSegment segment = 10; + + // Topical label annotations on video level or user-specified segment level. + // There is exactly one element for each unique label. + repeated LabelAnnotation segment_label_annotations = 2; + + // Presence label annotations on video level or user-specified segment level. + // There is exactly one element for each unique label. Compared to the + // existing topical `segment_label_annotations`, this field presents more + // fine-grained, segment-level labels detected in video content and is made + // available only when the client sets `LabelDetectionConfig.model` to + // "builtin/latest" in the request. + repeated LabelAnnotation segment_presence_label_annotations = 23; + + // Topical label annotations on shot level. + // There is exactly one element for each unique label. + repeated LabelAnnotation shot_label_annotations = 3; + + // Presence label annotations on shot level. There is exactly one element for + // each unique label. Compared to the existing topical + // `shot_label_annotations`, this field presents more fine-grained, shot-level + // labels detected in video content and is made available only when the client + // sets `LabelDetectionConfig.model` to "builtin/latest" in the request. + repeated LabelAnnotation shot_presence_label_annotations = 24; + + // Label annotations on frame level. + // There is exactly one element for each unique label. + repeated LabelAnnotation frame_label_annotations = 4; + + // Deprecated. Please use `face_detection_annotations` instead. + repeated FaceAnnotation face_annotations = 5 [deprecated = true]; + + // Face detection annotations. + repeated FaceDetectionAnnotation face_detection_annotations = 13; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 6; + + // Explicit content annotation. + ExplicitContentAnnotation explicit_annotation = 7; + + // Speech transcription. + repeated SpeechTranscription speech_transcriptions = 11; + + // OCR text detection and tracking. + // Annotations for list of detected text snippets. Each will have list of + // frame information associated with it. + repeated TextAnnotation text_annotations = 12; + + // Annotations for list of objects detected and tracked in video. + repeated ObjectTrackingAnnotation object_annotations = 14; + + // Annotations for list of logos detected, tracked and recognized in video. + repeated LogoRecognitionAnnotation logo_recognition_annotations = 19; + + // Person detection annotations. + repeated PersonDetectionAnnotation person_detection_annotations = 20; + + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + google.rpc.Status error = 9; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Video file location in + // [Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Approximate percentage processed thus far. Guaranteed to be + // 100 when fully processed. + int32 progress_percent = 2; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Time of the most recent update. + google.protobuf.Timestamp update_time = 4; + + // Specifies which feature is being tracked if the request contains more than + // one feature. + Feature feature = 5; + + // Specifies which segment is being tracked if the request contains more than + // one segment. + VideoSegment segment = 6; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// Config for SPEECH_TRANSCRIPTION. +message SpeechTranscriptionConfig { + // Required. *Required* The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language Support](https://cloud.google.com/speech/docs/languages) + // for a list of the currently supported language codes. + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechTranscription`. The server may return fewer than + // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + // return a maximum of one. If omitted, will return a maximum of one. + int32 max_alternatives = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool filter_profanity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A means to provide context to assist the speech recognition. + repeated SpeechContext speech_contexts = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. The default 'false' value + // does not add punctuation to result hypotheses. NOTE: "This is currently + // offered as an experimental service, complimentary to all users. In the + // future this may be exclusively available as a premium feature." + bool enable_automatic_punctuation = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For file formats, such as MXF or MKV, supporting multiple audio + // tracks, specify up to two tracks. Default: track 0. + repeated int32 audio_tracks = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_tag provided + // in the WordInfo. + // Note: When this is true, we send all the words from the beginning of the + // audio for the top alternative in every consecutive response. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + bool enable_speaker_diarization = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, specifies the estimated number of speakers in the + // conversation. If not set, defaults to '2'. Ignored unless + // enable_speaker_diarization is set to true. + int32 diarization_speaker_count = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // Optional. A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech/limits#content). + repeated string phrases = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechTranscription { + // May contain one or more recognition hypotheses (up to the maximum specified + // in `max_alternatives`). These alternatives are ordered in terms of + // accuracy, with the top (first) alternative being the most probable, as + // ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + string transcript = 1; + + // Output only. The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is set to true, you will see all + // the words from the beginning of the audio. + repeated WordInfo words = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Word-specific information for recognized words. Word information is only +// included in the response when certain request parameters are set, such +// as `enable_word_time_offsets`. +message WordInfo { + // Time offset relative to the beginning of the audio, and + // corresponding to the start of the spoken word. This field is only set if + // `enable_word_time_offsets=true` and only in the top hypothesis. This is an + // experimental feature and the accuracy of the time offset can vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, and + // corresponding to the end of the spoken word. This field is only set if + // `enable_word_time_offsets=true` and only in the top hypothesis. This is an + // experimental feature and the accuracy of the time offset can vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // Output only. The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from 1 up to diarization_speaker_count, + // and is only set if speaker diarization is enabled. + int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// Normalized bounding polygon for text (that might not be aligned with axis). +// Contains list of the corner points in clockwise order starting from +// top-left corner. For example, for a rectangular bounding box: +// When the text is horizontal it might look like: +// 0----1 +// | | +// 3----2 +// +// When it's clockwise rotated 180 degrees around the top-left corner it +// becomes: +// 2----3 +// | | +// 1----0 +// +// and the vertex order will still be (0, 1, 2, 3). Note that values can be less +// than 0, or greater than 1 due to trignometric calculations for location of +// the box. +message NormalizedBoundingPoly { + // Normalized vertices of the bounding polygon. + repeated NormalizedVertex vertices = 1; +} + +// Video segment level annotation results for text detection. +message TextSegment { + // Video segment where a text snippet was detected. + VideoSegment segment = 1; + + // Confidence for the track of detected text. It is calculated as the highest + // over all frames where OCR detected text appears. + float confidence = 2; + + // Information related to the frames where OCR detected text appears. + repeated TextFrame frames = 3; +} + +// Video frame level annotation results for text annotation (OCR). +// Contains information regarding timestamp and bounding box locations for the +// frames containing detected OCR text snippets. +message TextFrame { + // Bounding polygon of the detected text for this frame. + NormalizedBoundingPoly rotated_bounding_box = 1; + + // Timestamp of this frame. + google.protobuf.Duration time_offset = 2; +} + +// Annotations related to one detected OCR text snippet. This will contain the +// corresponding text, confidence value, and frame level information for each +// detection. +message TextAnnotation { + // The detected text. + string text = 1; + + // All video segments where OCR detected text appears. + repeated TextSegment segments = 2; + + // Feature version. + string version = 3; +} + +// Video frame level annotations for object detection and tracking. This field +// stores per frame location, time offset, and confidence. +message ObjectTrackingFrame { + // The normalized bounding box location of this object track for the frame. + NormalizedBoundingBox normalized_bounding_box = 1; + + // The timestamp of the frame in microseconds. + google.protobuf.Duration time_offset = 2; +} + +// Annotations corresponding to one tracked object. +message ObjectTrackingAnnotation { + // Different representation of tracking info in non-streaming batch + // and streaming modes. + oneof track_info { + // Non-streaming batch mode ONLY. + // Each object track corresponds to one video segment where it appears. + VideoSegment segment = 3; + + // Streaming mode ONLY. + // In streaming mode, we do not know the end time of a tracked object + // before it is completed. Hence, there is no VideoSegment info returned. + // Instead, we provide a unique identifiable integer track_id so that + // the customers can correlate the results of the ongoing + // ObjectTrackAnnotation of the same track_id over time. + int64 track_id = 5; + } + + // Entity to specify the object category that this track is labeled as. + Entity entity = 1; + + // Object category's labeling confidence of this track. + float confidence = 4; + + // Information corresponding to all frames where this object track appears. + // Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame + // messages in frames. + // Streaming mode: it can only be one ObjectTrackingFrame message in frames. + repeated ObjectTrackingFrame frames = 2; + + // Feature version. + string version = 6; +} + +// Annotation corresponding to one detected, tracked and recognized logo class. +message LogoRecognitionAnnotation { + // Entity category information to specify the logo class that all the logo + // tracks within this LogoRecognitionAnnotation are recognized as. + Entity entity = 1; + + // All logo tracks where the recognized logo appears. Each track corresponds + // to one logo instance appearing in consecutive frames. + repeated Track tracks = 2; + + // All video segments where the recognized logo appears. There might be + // multiple instances of the same logo class appearing in one VideoSegment. + repeated VideoSegment segments = 3; +} diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1beta1/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1beta1/video_intelligence.proto new file mode 100644 index 00000000000..430776bf003 --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1beta1/video_intelligence.proto @@ -0,0 +1,345 @@ +// Copyright 2017 Google Inc. +// +// 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.videointelligence.v1beta1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1beta1"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1beta1"; +option ruby_package = "Google::Cloud::VideoIntelligence::V1beta1"; + +// Service that implements Google Cloud Video Intelligence API. +service VideoIntelligenceService { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/videos:annotate" + body: "*" + }; + } +} + +// Video annotation request. +message AnnotateVideoRequest { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request URIs](/storage/docs/reference-uris). A video + // URI may include wildcards in `object-id`, and thus identify multiple + // videos. Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + string input_uri = 1; + + // The video data bytes. Encoding: base64. If unset, the input video(s) + // should be specified via `input_uri`. If set, `input_uri` should be unset. + string input_content = 6; + + // Requested video annotation features. + repeated Feature features = 2; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // Optional location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request URIs](/storage/docs/reference-uris). + string output_uri = 4; + + // Optional cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + string location_id = 5; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video + // is treated as a single segment. + repeated VideoSegment segments = 1; + + // If label detection has been requested, what labels should be detected + // in addition to video-level labels or segment-level labels. If unspecified, + // defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 2; + + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + bool stationary_camera = 3; + + // Model to use for label detection. + // Supported values: "latest" and "stable" (the default). + string label_detection_model = 4; + + // Model to use for face detection. + // Supported values: "latest" and "stable" (the default). + string face_detection_model = 5; + + // Model to use for shot change detection. + // Supported values: "latest" and "stable" (the default). + string shot_change_detection_model = 6; + + // Model to use for safe search detection. + // Supported values: "latest" and "stable" (the default). + string safe_search_detection_model = 7; +} + +// Video segment. +message VideoSegment { + // Start offset in microseconds (inclusive). Unset means 0. + int64 start_time_offset = 1; + + // End offset in microseconds (inclusive). Unset means 0. + int64 end_time_offset = 2; +} + +// Label location. +message LabelLocation { + // Video segment. Set to [-1, -1] for video-level labels. + // Set to [timestamp, timestamp] for frame-level labels. + // Otherwise, corresponds to one of `AnnotateSpec.segments` + // (if specified) or to shot boundaries (if requested). + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; + + // Label level. + LabelLevel level = 3; +} + +// Label annotation. +message LabelAnnotation { + // Textual description, e.g. `Fixed-gear bicycle`. + string description = 1; + + // Language code for `description` in BCP-47 format. + string language_code = 2; + + // Where the label was detected and with what confidence. + repeated LabelLocation locations = 3; +} + +// Safe search annotation (based on per-frame visual signals only). +// If no unsafe content has been detected in a frame, no annotations +// are present for that frame. If only some types of unsafe content +// have been detected in a frame, the likelihood is set to `UNKNOWN` +// for all other types of unsafe content. +message SafeSearchAnnotation { + // Likelihood of adult content. + Likelihood adult = 1; + + // Likelihood that an obvious modification was made to the original + // version to make it appear funny or offensive. + Likelihood spoof = 2; + + // Likelihood of medical content. + Likelihood medical = 3; + + // Likelihood of violent content. + Likelihood violent = 4; + + // Likelihood of racy content. + Likelihood racy = 5; + + // Video time offset in microseconds. + int64 time_offset = 6; +} + +// Bounding box. +message BoundingBox { + // Left X coordinate. + int32 left = 1; + + // Right X coordinate. + int32 right = 2; + + // Bottom Y coordinate. + int32 bottom = 3; + + // Top Y coordinate. + int32 top = 4; +} + +// Face location. +message FaceLocation { + // Bounding box in a frame. + BoundingBox bounding_box = 1; + + // Video time offset in microseconds. + int64 time_offset = 2; +} + +// Face annotation. +message FaceAnnotation { + // Thumbnail of a representative face view (in JPEG format). Encoding: base64. + string thumbnail = 1; + + // All locations where a face was detected. + // Faces are detected and tracked on a per-video basis + // (as opposed to across multiple videos). + repeated VideoSegment segments = 2; + + // Face locations at one frame per second. + repeated FaceLocation locations = 3; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Label annotations. There is exactly one element for each unique label. + repeated LabelAnnotation label_annotations = 2; + + // Face annotations. There is exactly one element for each unique face. + repeated FaceAnnotation face_annotations = 3; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 4; + + // Safe search annotations. + repeated SafeSearchAnnotation safe_search_annotations = 6; + + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + google.rpc.Status error = 5; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Approximate percentage processed thus far. + // Guaranteed to be 100 when fully processed. + int32 progress_percent = 2; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Time of the most recent update. + google.protobuf.Timestamp update_time = 4; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Human face detection and tracking. + FACE_DETECTION = 2; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 3; + + // Safe search detection. + SAFE_SEARCH_DETECTION = 4; +} + +// Label level (scope). +enum LabelLevel { + // Unspecified. + LABEL_LEVEL_UNSPECIFIED = 0; + + // Video-level. Corresponds to the whole video. + VIDEO_LEVEL = 1; + + // Segment-level. Corresponds to one of `AnnotateSpec.segments`. + SEGMENT_LEVEL = 2; + + // Shot-level. Corresponds to a single shot (i.e. a series of frames + // without a major camera position or background change). + SHOT_LEVEL = 3; + + // Frame-level. Corresponds to a single video frame. + FRAME_LEVEL = 4; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unknown likelihood. + UNKNOWN = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1beta2/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1beta2/video_intelligence.proto new file mode 100644 index 00000000000..81648c523ec --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1beta2/video_intelligence.proto @@ -0,0 +1,410 @@ +// Copyright 2019 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.videointelligence.v1beta2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1Beta2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1beta2"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1beta2"; +option ruby_package = "Google::Cloud::VideoIntelligence::V1beta2"; + +// Service that implements Google Cloud Video Intelligence API. +service VideoIntelligenceService { + option (google.api.default_host) = "videointelligence.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/videos:annotate" + body: "*" + }; + option (google.api.method_signature) = "input_uri,features"; + option (google.longrunning.operation_info) = { + response_type: "AnnotateVideoResponse" + metadata_type: "AnnotateVideoProgress" + }; + } +} + +// Video annotation request. +message AnnotateVideoRequest { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + // may include wildcards in `object-id`, and thus identify multiple videos. + // Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + string input_uri = 1; + + // The video data bytes. + // If unset, the input video(s) should be specified via `input_uri`. + // If set, `input_uri` should be unset. + bytes input_content = 6; + + // Required. Requested video annotation features. + repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // Optional. Location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). + string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video is + // treated as a single segment. + repeated VideoSegment segments = 1; + + // Config for LABEL_DETECTION. + LabelDetectionConfig label_detection_config = 2; + + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig shot_change_detection_config = 3; + + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig explicit_content_detection_config = 4; + + // Config for FACE_DETECTION. + FaceDetectionConfig face_detection_config = 5; +} + +// Config for LABEL_DETECTION. +message LabelDetectionConfig { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 1; + + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + // Should be used with `SHOT_AND_FRAME_MODE` enabled. + bool stationary_camera = 2; + + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; +} + +// Config for SHOT_CHANGE_DETECTION. +message ShotChangeDetectionConfig { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for EXPLICIT_CONTENT_DETECTION. +message ExplicitContentDetectionConfig { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for FACE_DETECTION. +message FaceDetectionConfig { + // Model to use for face detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; + + // Whether bounding boxes be included in the face annotation output. + bool include_bounding_boxes = 2; +} + +// Video segment. +message VideoSegment { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + google.protobuf.Duration start_time_offset = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + google.protobuf.Duration end_time_offset = 2; +} + +// Video segment level annotation results for label detection. +message LabelSegment { + // Video segment where a label was detected. + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Video frame level annotation results for label detection. +message LabelFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Detected entity from video analysis. +message Entity { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string entity_id = 1; + + // Textual description, e.g. `Fixed-gear bicycle`. + string description = 2; + + // Language code for `description` in BCP-47 format. + string language_code = 3; +} + +// Label annotation. +message LabelAnnotation { + // Detected entity. + Entity entity = 1; + + // Common categories for the detected entity. + // E.g. when the label is `Terrier` the category is likely `dog`. And in some + // cases there might be more than one categories e.g. `Terrier` could also be + // a `pet`. + repeated Entity category_entities = 2; + + // All video segments where a label was detected. + repeated LabelSegment segments = 3; + + // All video frames where a label was detected. + repeated LabelFrame frames = 4; +} + +// Video frame level annotation results for explicit content. +message ExplicitContentFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Likelihood of the pornography content.. + Likelihood pornography_likelihood = 2; +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +message ExplicitContentAnnotation { + // All video frames where explicit content was detected. + repeated ExplicitContentFrame frames = 1; +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +message NormalizedBoundingBox { + // Left X coordinate. + float left = 1; + + // Top Y coordinate. + float top = 2; + + // Right X coordinate. + float right = 3; + + // Bottom Y coordinate. + float bottom = 4; +} + +// Video segment level annotation results for face detection. +message FaceSegment { + // Video segment where a face was detected. + VideoSegment segment = 1; +} + +// Video frame level annotation results for face detection. +message FaceFrame { + // Normalized Bounding boxes in a frame. + // There can be more than one boxes if the same face is detected in multiple + // locations within the current frame. + repeated NormalizedBoundingBox normalized_bounding_boxes = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the video frame for this location. + google.protobuf.Duration time_offset = 2; +} + +// Face annotation. +message FaceAnnotation { + // Thumbnail of a representative face view (in JPEG format). + bytes thumbnail = 1; + + // All video segments where a face was detected. + repeated FaceSegment segments = 2; + + // All video frames where a face was detected. + repeated FaceFrame frames = 3; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Label annotations on video level or user specified segment level. + // There is exactly one element for each unique label. + repeated LabelAnnotation segment_label_annotations = 2; + + // Label annotations on shot level. + // There is exactly one element for each unique label. + repeated LabelAnnotation shot_label_annotations = 3; + + // Label annotations on frame level. + // There is exactly one element for each unique label. + repeated LabelAnnotation frame_label_annotations = 4; + + // Face annotations. There is exactly one element for each unique face. + repeated FaceAnnotation face_annotations = 5; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 6; + + // Explicit content annotation. + ExplicitContentAnnotation explicit_annotation = 7; + + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + google.rpc.Status error = 9; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Approximate percentage processed thus far. + // Guaranteed to be 100 when fully processed. + int32 progress_percent = 2; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Time of the most recent update. + google.protobuf.Timestamp update_time = 4; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + EXPLICIT_CONTENT_DETECTION = 3; + + // Human face detection and tracking. + FACE_DETECTION = 4; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unspecified likelihood. + LIKELIHOOD_UNSPECIFIED = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p1beta1/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p1beta1/video_intelligence.proto new file mode 100644 index 00000000000..3c0b8b5626c --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p1beta1/video_intelligence.proto @@ -0,0 +1,450 @@ +// Copyright 2019 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.videointelligence.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p1beta1;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1p1beta1"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p1beta1"; +option ruby_package = "Google::Cloud::VideoIntelligence::V1p1beta1"; + +// Service that implements Google Cloud Video Intelligence API. +service VideoIntelligenceService { + option (google.api.default_host) = "videointelligence.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/videos:annotate" + body: "*" + }; + option (google.api.method_signature) = "input_uri,features"; + option (google.longrunning.operation_info) = { + response_type: "AnnotateVideoResponse" + metadata_type: "AnnotateVideoProgress" + }; + } +} + +// Video annotation request. +message AnnotateVideoRequest { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + // may include wildcards in `object-id`, and thus identify multiple videos. + // Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + string input_uri = 1; + + // The video data bytes. + // If unset, the input video(s) should be specified via `input_uri`. + // If set, `input_uri` should be unset. + bytes input_content = 6; + + // Required. Requested video annotation features. + repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // Optional. Location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). + string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video is + // treated as a single segment. + repeated VideoSegment segments = 1; + + // Config for LABEL_DETECTION. + LabelDetectionConfig label_detection_config = 2; + + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig shot_change_detection_config = 3; + + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig explicit_content_detection_config = 4; + + // Config for SPEECH_TRANSCRIPTION. + SpeechTranscriptionConfig speech_transcription_config = 6; +} + +// Config for LABEL_DETECTION. +message LabelDetectionConfig { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 1; + + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + // Should be used with `SHOT_AND_FRAME_MODE` enabled. + bool stationary_camera = 2; + + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; +} + +// Config for SHOT_CHANGE_DETECTION. +message ShotChangeDetectionConfig { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for EXPLICIT_CONTENT_DETECTION. +message ExplicitContentDetectionConfig { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Video segment. +message VideoSegment { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + google.protobuf.Duration start_time_offset = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + google.protobuf.Duration end_time_offset = 2; +} + +// Video segment level annotation results for label detection. +message LabelSegment { + // Video segment where a label was detected. + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Video frame level annotation results for label detection. +message LabelFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Detected entity from video analysis. +message Entity { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string entity_id = 1; + + // Textual description, e.g. `Fixed-gear bicycle`. + string description = 2; + + // Language code for `description` in BCP-47 format. + string language_code = 3; +} + +// Label annotation. +message LabelAnnotation { + // Detected entity. + Entity entity = 1; + + // Common categories for the detected entity. + // E.g. when the label is `Terrier` the category is likely `dog`. And in some + // cases there might be more than one categories e.g. `Terrier` could also be + // a `pet`. + repeated Entity category_entities = 2; + + // All video segments where a label was detected. + repeated LabelSegment segments = 3; + + // All video frames where a label was detected. + repeated LabelFrame frames = 4; +} + +// Video frame level annotation results for explicit content. +message ExplicitContentFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Likelihood of the pornography content.. + Likelihood pornography_likelihood = 2; +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +message ExplicitContentAnnotation { + // All video frames where explicit content was detected. + repeated ExplicitContentFrame frames = 1; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Output only. Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Label annotations on video level or user specified segment level. + // There is exactly one element for each unique label. + repeated LabelAnnotation segment_label_annotations = 2; + + // Label annotations on shot level. + // There is exactly one element for each unique label. + repeated LabelAnnotation shot_label_annotations = 3; + + // Label annotations on frame level. + // There is exactly one element for each unique label. + repeated LabelAnnotation frame_label_annotations = 4; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 6; + + // Explicit content annotation. + ExplicitContentAnnotation explicit_annotation = 7; + + // Speech transcription. + repeated SpeechTranscription speech_transcriptions = 11; + + // Output only. If set, indicates an error. Note that for a single + // `AnnotateVideoRequest` some videos may succeed and some may fail. + google.rpc.Status error = 9; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Output only. Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Output only. Approximate percentage processed thus far. Guaranteed to be + // 100 when fully processed. + int32 progress_percent = 2; + + // Output only. Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Output only. Time of the most recent update. + google.protobuf.Timestamp update_time = 4; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// Config for SPEECH_TRANSCRIPTION. +message SpeechTranscriptionConfig { + // Required. *Required* The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language Support](https://cloud.google.com/speech/docs/languages) + // for a list of the currently supported language codes. + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechTranscription`. The server may return fewer than + // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + // return a maximum of one. If omitted, will return a maximum of one. + int32 max_alternatives = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool filter_profanity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A means to provide context to assist the speech recognition. + repeated SpeechContext speech_contexts = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. The default 'false' value + // does not add punctuation to result hypotheses. NOTE: "This is currently + // offered as an experimental service, complimentary to all users. In the + // future this may be exclusively available as a premium feature." + bool enable_automatic_punctuation = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For file formats, such as MXF or MKV, supporting multiple audio + // tracks, specify up to two tracks. Default: track 0. + repeated int32 audio_tracks = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // Optional. A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech/limits#content). + repeated string phrases = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechTranscription { + // May contain one or more recognition hypotheses (up to the maximum specified + // in `max_alternatives`). These alternatives are ordered in terms of + // accuracy, with the top (first) alternative being the most probable, as + // ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Output only. Transcript text representing the words that the user spoke. + string transcript = 1; + + // Output only. The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of word-specific information for each recognized word. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. Word information is only +// included in the response when certain request parameters are set, such +// as `enable_word_time_offsets`. +message WordInfo { + // Output only. Time offset relative to the beginning of the audio, and + // corresponding to the start of the spoken word. This field is only set if + // `enable_word_time_offsets=true` and only in the top hypothesis. This is an + // experimental feature and the accuracy of the time offset can vary. + google.protobuf.Duration start_time = 1; + + // Output only. Time offset relative to the beginning of the audio, and + // corresponding to the end of the spoken word. This field is only set if + // `enable_word_time_offsets=true` and only in the top hypothesis. This is an + // experimental feature and the accuracy of the time offset can vary. + google.protobuf.Duration end_time = 2; + + // Output only. The word corresponding to this set of information. + string word = 3; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + EXPLICIT_CONTENT_DETECTION = 3; + + // Speech transcription. + SPEECH_TRANSCRIPTION = 6; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unspecified likelihood. + LIKELIHOOD_UNSPECIFIED = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto new file mode 100644 index 00000000000..c185c0aa99b --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto @@ -0,0 +1,489 @@ +// Copyright 2019 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.videointelligence.v1p2beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P2Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1p2beta1"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p2beta1"; +option ruby_package = "Google::Cloud::VideoIntelligence::V1p2beta1"; + +// Service that implements Google Cloud Video Intelligence API. +service VideoIntelligenceService { + option (google.api.default_host) = "videointelligence.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p2beta1/videos:annotate" + body: "*" + }; + option (google.api.method_signature) = "input_uri,features"; + option (google.longrunning.operation_info) = { + response_type: "AnnotateVideoResponse" + metadata_type: "AnnotateVideoProgress" + }; + } +} + +// Video annotation request. +message AnnotateVideoRequest { + // Input video location. Currently, only + // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). + // A video URI may include wildcards in `object-id`, and thus identify + // multiple videos. Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` should be unset. + string input_uri = 1; + + // The video data bytes. + // If unset, the input video(s) should be specified via `input_uri`. + // If set, `input_uri` should be unset. + bytes input_content = 6; + + // Required. Requested video annotation features. + repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // Optional. Location where the output (in JSON format) should be stored. + // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported, which must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). + string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud region where annotation should take place. Supported cloud + // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + // is specified, a region will be determined based on video file location. + string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video is + // treated as a single segment. + repeated VideoSegment segments = 1; + + // Config for LABEL_DETECTION. + LabelDetectionConfig label_detection_config = 2; + + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig shot_change_detection_config = 3; + + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig explicit_content_detection_config = 4; + + // Config for TEXT_DETECTION. + TextDetectionConfig text_detection_config = 8; +} + +// Config for LABEL_DETECTION. +message LabelDetectionConfig { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 1; + + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + // Should be used with `SHOT_AND_FRAME_MODE` enabled. + bool stationary_camera = 2; + + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; +} + +// Config for SHOT_CHANGE_DETECTION. +message ShotChangeDetectionConfig { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for EXPLICIT_CONTENT_DETECTION. +message ExplicitContentDetectionConfig { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for TEXT_DETECTION. +message TextDetectionConfig { + // Language hint can be specified if the language to be detected is known a + // priori. It can increase the accuracy of the detection. Language hint must + // be language code in BCP-47 format. + // + // Automatic language detection is performed if no hint is provided. + repeated string language_hints = 1; +} + +// Video segment. +message VideoSegment { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + google.protobuf.Duration start_time_offset = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + google.protobuf.Duration end_time_offset = 2; +} + +// Video segment level annotation results for label detection. +message LabelSegment { + // Video segment where a label was detected. + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Video frame level annotation results for label detection. +message LabelFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Detected entity from video analysis. +message Entity { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string entity_id = 1; + + // Textual description, e.g. `Fixed-gear bicycle`. + string description = 2; + + // Language code for `description` in BCP-47 format. + string language_code = 3; +} + +// Label annotation. +message LabelAnnotation { + // Detected entity. + Entity entity = 1; + + // Common categories for the detected entity. + // E.g. when the label is `Terrier` the category is likely `dog`. And in some + // cases there might be more than one categories e.g. `Terrier` could also be + // a `pet`. + repeated Entity category_entities = 2; + + // All video segments where a label was detected. + repeated LabelSegment segments = 3; + + // All video frames where a label was detected. + repeated LabelFrame frames = 4; +} + +// Video frame level annotation results for explicit content. +message ExplicitContentFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Likelihood of the pornography content.. + Likelihood pornography_likelihood = 2; +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +message ExplicitContentAnnotation { + // All video frames where explicit content was detected. + repeated ExplicitContentFrame frames = 1; +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +message NormalizedBoundingBox { + // Left X coordinate. + float left = 1; + + // Top Y coordinate. + float top = 2; + + // Right X coordinate. + float right = 3; + + // Bottom Y coordinate. + float bottom = 4; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Label annotations on video level or user specified segment level. + // There is exactly one element for each unique label. + repeated LabelAnnotation segment_label_annotations = 2; + + // Label annotations on shot level. + // There is exactly one element for each unique label. + repeated LabelAnnotation shot_label_annotations = 3; + + // Label annotations on frame level. + // There is exactly one element for each unique label. + repeated LabelAnnotation frame_label_annotations = 4; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 6; + + // Explicit content annotation. + ExplicitContentAnnotation explicit_annotation = 7; + + // OCR text detection and tracking. + // Annotations for list of detected text snippets. Each will have list of + // frame information associated with it. + repeated TextAnnotation text_annotations = 12; + + // Annotations for list of objects detected and tracked in video. + repeated ObjectTrackingAnnotation object_annotations = 14; + + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + google.rpc.Status error = 9; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Approximate percentage processed thus far. Guaranteed to be + // 100 when fully processed. + int32 progress_percent = 2; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Time of the most recent update. + google.protobuf.Timestamp update_time = 4; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// Normalized bounding polygon for text (that might not be aligned with axis). +// Contains list of the corner points in clockwise order starting from +// top-left corner. For example, for a rectangular bounding box: +// When the text is horizontal it might look like: +// 0----1 +// | | +// 3----2 +// +// When it's clockwise rotated 180 degrees around the top-left corner it +// becomes: +// 2----3 +// | | +// 1----0 +// +// and the vertex order will still be (0, 1, 2, 3). Note that values can be less +// than 0, or greater than 1 due to trignometric calculations for location of +// the box. +message NormalizedBoundingPoly { + // Normalized vertices of the bounding polygon. + repeated NormalizedVertex vertices = 1; +} + +// Video segment level annotation results for text detection. +message TextSegment { + // Video segment where a text snippet was detected. + VideoSegment segment = 1; + + // Confidence for the track of detected text. It is calculated as the highest + // over all frames where OCR detected text appears. + float confidence = 2; + + // Information related to the frames where OCR detected text appears. + repeated TextFrame frames = 3; +} + +// Video frame level annotation results for text annotation (OCR). +// Contains information regarding timestamp and bounding box locations for the +// frames containing detected OCR text snippets. +message TextFrame { + // Bounding polygon of the detected text for this frame. + NormalizedBoundingPoly rotated_bounding_box = 1; + + // Timestamp of this frame. + google.protobuf.Duration time_offset = 2; +} + +// Annotations related to one detected OCR text snippet. This will contain the +// corresponding text, confidence value, and frame level information for each +// detection. +message TextAnnotation { + // The detected text. + string text = 1; + + // All video segments where OCR detected text appears. + repeated TextSegment segments = 2; +} + +// Video frame level annotations for object detection and tracking. This field +// stores per frame location, time offset, and confidence. +message ObjectTrackingFrame { + // The normalized bounding box location of this object track for the frame. + NormalizedBoundingBox normalized_bounding_box = 1; + + // The timestamp of the frame in microseconds. + google.protobuf.Duration time_offset = 2; +} + +// Annotations corresponding to one tracked object. +message ObjectTrackingAnnotation { + // Different representation of tracking info in non-streaming batch + // and streaming modes. + oneof track_info { + // Non-streaming batch mode ONLY. + // Each object track corresponds to one video segment where it appears. + VideoSegment segment = 3; + + // Streaming mode ONLY. + // In streaming mode, we do not know the end time of a tracked object + // before it is completed. Hence, there is no VideoSegment info returned. + // Instead, we provide a unique identifiable integer track_id so that + // the customers can correlate the results of the ongoing + // ObjectTrackAnnotation of the same track_id over time. + int64 track_id = 5; + } + + // Entity to specify the object category that this track is labeled as. + Entity entity = 1; + + // Object category's labeling confidence of this track. + float confidence = 4; + + // Information corresponding to all frames where this object track appears. + repeated ObjectTrackingFrame frames = 2; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + EXPLICIT_CONTENT_DETECTION = 3; + + // OCR text detection and tracking. + TEXT_DETECTION = 7; + + // Object detection and tracking. + OBJECT_TRACKING = 9; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unspecified likelihood. + LIKELIHOOD_UNSPECIFIED = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} diff --git a/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto new file mode 100644 index 00000000000..db039e67a0c --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto @@ -0,0 +1,1090 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.videointelligence.v1p3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p3beta1;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1p3beta1"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p3beta1"; +option ruby_package = "Google::Cloud::VideoIntelligence::V1p3beta1"; + +// Service that implements the Video Intelligence API. +service VideoIntelligenceService { + option (google.api.default_host) = "videointelligence.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p3beta1/videos:annotate" + body: "*" + }; + option (google.api.method_signature) = "input_uri,features"; + option (google.longrunning.operation_info) = { + response_type: "AnnotateVideoResponse" + metadata_type: "AnnotateVideoProgress" + }; + } +} + +// Service that implements streaming Video Intelligence API. +service StreamingVideoIntelligenceService { + option (google.api.default_host) = "videointelligence.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Performs video annotation with bidirectional streaming: emitting results + // while sending video/audio bytes. + // This method is only available via the gRPC API (not REST). + rpc StreamingAnnotateVideo(stream StreamingAnnotateVideoRequest) + returns (stream StreamingAnnotateVideoResponse) {} +} + +// Video annotation request. +message AnnotateVideoRequest { + // Input video location. Currently, only + // [Cloud Storage](https://cloud.google.com/storage/) URIs are + // supported. URIs must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + // multiple videos, a video URI may include wildcards in the `object-id`. + // Supported wildcards: '*' to match 0 or more characters; + // '?' to match 1 character. If unset, the input video should be embedded + // in the request as `input_content`. If set, `input_content` must be unset. + string input_uri = 1; + + // The video data bytes. + // If unset, the input video(s) should be specified via the `input_uri`. + // If set, `input_uri` must be unset. + bytes input_content = 6; + + // Required. Requested video annotation features. + repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // Optional. Location where the output (in JSON format) should be stored. + // Currently, only [Cloud Storage](https://cloud.google.com/storage/) + // URIs are supported. These must be specified in the following format: + // `gs://bucket-id/object-id` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + // more information, see [Request + // URIs](https://cloud.google.com/storage/docs/request-endpoints). + string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cloud region where annotation should take place. Supported cloud + // regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + // region is specified, the region will be determined based on video file + // location. + string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video is + // treated as a single segment. + repeated VideoSegment segments = 1; + + // Config for LABEL_DETECTION. + LabelDetectionConfig label_detection_config = 2; + + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig shot_change_detection_config = 3; + + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig explicit_content_detection_config = 4; + + // Config for FACE_DETECTION. + FaceDetectionConfig face_detection_config = 5; + + // Config for SPEECH_TRANSCRIPTION. + SpeechTranscriptionConfig speech_transcription_config = 6; + + // Config for TEXT_DETECTION. + TextDetectionConfig text_detection_config = 8; + + // Config for PERSON_DETECTION. + PersonDetectionConfig person_detection_config = 11; + + // Config for OBJECT_TRACKING. + ObjectTrackingConfig object_tracking_config = 13; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unspecified likelihood. + LIKELIHOOD_UNSPECIFIED = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} + +// Config for LABEL_DETECTION. +message LabelDetectionConfig { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 1; + + // Whether the video has been shot from a stationary (i.e., non-moving) + // camera. When set to true, might improve detection accuracy for moving + // objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + bool stationary_camera = 2; + + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; + + // The confidence threshold we perform filtering on the labels from + // frame-level detection. If not set, it is set to 0.4 by default. The valid + // range for this threshold is [0.1, 0.9]. Any value set outside of this + // range will be clipped. + // Note: For best results, follow the default threshold. We will update + // the default threshold everytime when we release a new model. + float frame_confidence_threshold = 4; + + // The confidence threshold we perform filtering on the labels from + // video-level and shot-level detections. If not set, it's set to 0.3 by + // default. The valid range for this threshold is [0.1, 0.9]. Any value set + // outside of this range will be clipped. + // Note: For best results, follow the default threshold. We will update + // the default threshold everytime when we release a new model. + float video_confidence_threshold = 5; +} + +// Streaming video annotation feature. +enum StreamingFeature { + // Unspecified. + STREAMING_FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + STREAMING_LABEL_DETECTION = 1; + + // Shot change detection. + STREAMING_SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + STREAMING_EXPLICIT_CONTENT_DETECTION = 3; + + // Object detection and tracking. + STREAMING_OBJECT_TRACKING = 4; + + // Action recognition based on AutoML model. + STREAMING_AUTOML_ACTION_RECOGNITION = 23; + + // Video classification based on AutoML model. + STREAMING_AUTOML_CLASSIFICATION = 21; + + // Object detection and tracking based on AutoML model. + STREAMING_AUTOML_OBJECT_TRACKING = 22; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + EXPLICIT_CONTENT_DETECTION = 3; + + // Human face detection. + FACE_DETECTION = 4; + + // Speech transcription. + SPEECH_TRANSCRIPTION = 6; + + // OCR text detection and tracking. + TEXT_DETECTION = 7; + + // Object detection and tracking. + OBJECT_TRACKING = 9; + + // Logo detection, tracking, and recognition. + LOGO_RECOGNITION = 12; + + // Celebrity recognition. + CELEBRITY_RECOGNITION = 13; + + // Person detection. + PERSON_DETECTION = 14; +} + +// Config for SHOT_CHANGE_DETECTION. +message ShotChangeDetectionConfig { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for OBJECT_TRACKING. +message ObjectTrackingConfig { + // Model to use for object tracking. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for EXPLICIT_CONTENT_DETECTION. +message ExplicitContentDetectionConfig { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for FACE_DETECTION. +message FaceDetectionConfig { + // Model to use for face detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; + + // Whether bounding boxes are included in the face annotation output. + bool include_bounding_boxes = 2; + + // Whether to enable face attributes detection, such as glasses, dark_glasses, + // mouth_open etc. Ignored if 'include_bounding_boxes' is set to false. + bool include_attributes = 5; +} + +// Config for PERSON_DETECTION. +message PersonDetectionConfig { + // Whether bounding boxes are included in the person detection annotation + // output. + bool include_bounding_boxes = 1; + + // Whether to enable pose landmarks detection. Ignored if + // 'include_bounding_boxes' is set to false. + bool include_pose_landmarks = 2; + + // Whether to enable person attributes detection, such as cloth color (black, + // blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, + // etc. + // Ignored if 'include_bounding_boxes' is set to false. + bool include_attributes = 3; +} + +// Config for TEXT_DETECTION. +message TextDetectionConfig { + // Language hint can be specified if the language to be detected is known a + // priori. It can increase the accuracy of the detection. Language hint must + // be language code in BCP-47 format. + // + // Automatic language detection is performed if no hint is provided. + repeated string language_hints = 1; + + // Model to use for text detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 2; +} + +// Video segment. +message VideoSegment { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + google.protobuf.Duration start_time_offset = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + google.protobuf.Duration end_time_offset = 2; +} + +// Video segment level annotation results for label detection. +message LabelSegment { + // Video segment where a label was detected. + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Video frame level annotation results for label detection. +message LabelFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Detected entity from video analysis. +message Entity { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string entity_id = 1; + + // Textual description, e.g., `Fixed-gear bicycle`. + string description = 2; + + // Language code for `description` in BCP-47 format. + string language_code = 3; +} + +// Label annotation. +message LabelAnnotation { + // Detected entity. + Entity entity = 1; + + // Common categories for the detected entity. + // For example, when the label is `Terrier`, the category is likely `dog`. And + // in some cases there might be more than one categories e.g., `Terrier` could + // also be a `pet`. + repeated Entity category_entities = 2; + + // All video segments where a label was detected. + repeated LabelSegment segments = 3; + + // All video frames where a label was detected. + repeated LabelFrame frames = 4; +} + +// Video frame level annotation results for explicit content. +message ExplicitContentFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Likelihood of the pornography content.. + Likelihood pornography_likelihood = 2; +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +message ExplicitContentAnnotation { + // All video frames where explicit content was detected. + repeated ExplicitContentFrame frames = 1; +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +message NormalizedBoundingBox { + // Left X coordinate. + float left = 1; + + // Top Y coordinate. + float top = 2; + + // Right X coordinate. + float right = 3; + + // Bottom Y coordinate. + float bottom = 4; +} + +// For tracking related features. +// An object at time_offset with attributes, and located with +// normalized_bounding_box. +message TimestampedObject { + // Normalized Bounding box in a frame, where the object is located. + NormalizedBoundingBox normalized_bounding_box = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the video frame for this object. + google.protobuf.Duration time_offset = 2; + + // Optional. The attributes of the object in the bounding box. + repeated DetectedAttribute attributes = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The detected landmarks. + repeated DetectedLandmark landmarks = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A track of an object instance. +message Track { + // Video segment of a track. + VideoSegment segment = 1; + + // The object with timestamp and attributes per frame in the track. + repeated TimestampedObject timestamped_objects = 2; + + // Optional. Attributes in the track level. + repeated DetectedAttribute attributes = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The confidence score of the tracked object. + float confidence = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A generic detected attribute represented by name in string format. +message DetectedAttribute { + // The name of the attribute, for example, glasses, dark_glasses, mouth_open. + // A full list of supported type names will be provided in the document. + string name = 1; + + // Detected attribute confidence. Range [0, 1]. + float confidence = 2; + + // Text value of the detection result. For example, the value for "HairColor" + // can be "black", "blonde", etc. + string value = 3; +} + +// Celebrity definition. +message Celebrity { + // The resource name of the celebrity. Have the format + // `video-intelligence/kg-mid` indicates a celebrity from preloaded gallery. + // kg-mid is the id in Google knowledge graph, which is unique for the + // celebrity. + string name = 1; + + // The celebrity name. + string display_name = 2; + + // Textual description of additional information about the celebrity, if + // applicable. + string description = 3; +} + +// The annotation result of a celebrity face track. RecognizedCelebrity field +// could be empty if the face track does not have any matched celebrities. +message CelebrityTrack { + // The recognized celebrity with confidence score. + message RecognizedCelebrity { + // The recognized celebrity. + Celebrity celebrity = 1; + + // Recognition confidence. Range [0, 1]. + float confidence = 2; + } + + // Top N match of the celebrities for the face in this track. + repeated RecognizedCelebrity celebrities = 1; + + // A track of a person's face. + Track face_track = 3; +} + +// Celebrity recognition annotation per video. +message CelebrityRecognitionAnnotation { + // The tracks detected from the input video, including recognized celebrities + // and other detected faces in the video. + repeated CelebrityTrack celebrity_tracks = 1; +} + +// A generic detected landmark represented by name in string format and a 2D +// location. +message DetectedLandmark { + // The name of this landmark, for example, left_hand, right_shoulder. + string name = 1; + + // The 2D point of the detected landmark using the normalized image + // coordindate system. The normalized coordinates have the range from 0 to 1. + NormalizedVertex point = 2; + + // The confidence score of the detected landmark. Range [0, 1]. + float confidence = 3; +} + +// Face detection annotation. +message FaceDetectionAnnotation { + // The face tracks with attributes. + repeated Track tracks = 3; + + // The thumbnail of a person's face. + bytes thumbnail = 4; +} + +// Person detection annotation per video. +message PersonDetectionAnnotation { + // The detected tracks of a person. + repeated Track tracks = 1; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Video file location in + // [Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Video segment on which the annotation is run. + VideoSegment segment = 10; + + // Topical label annotations on video level or user-specified segment level. + // There is exactly one element for each unique label. + repeated LabelAnnotation segment_label_annotations = 2; + + // Presence label annotations on video level or user-specified segment level. + // There is exactly one element for each unique label. Compared to the + // existing topical `segment_label_annotations`, this field presents more + // fine-grained, segment-level labels detected in video content and is made + // available only when the client sets `LabelDetectionConfig.model` to + // "builtin/latest" in the request. + repeated LabelAnnotation segment_presence_label_annotations = 23; + + // Topical label annotations on shot level. + // There is exactly one element for each unique label. + repeated LabelAnnotation shot_label_annotations = 3; + + // Presence label annotations on shot level. There is exactly one element for + // each unique label. Compared to the existing topical + // `shot_label_annotations`, this field presents more fine-grained, shot-level + // labels detected in video content and is made available only when the client + // sets `LabelDetectionConfig.model` to "builtin/latest" in the request. + repeated LabelAnnotation shot_presence_label_annotations = 24; + + // Label annotations on frame level. + // There is exactly one element for each unique label. + repeated LabelAnnotation frame_label_annotations = 4; + + // Face detection annotations. + repeated FaceDetectionAnnotation face_detection_annotations = 13; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 6; + + // Explicit content annotation. + ExplicitContentAnnotation explicit_annotation = 7; + + // Speech transcription. + repeated SpeechTranscription speech_transcriptions = 11; + + // OCR text detection and tracking. + // Annotations for list of detected text snippets. Each will have list of + // frame information associated with it. + repeated TextAnnotation text_annotations = 12; + + // Annotations for list of objects detected and tracked in video. + repeated ObjectTrackingAnnotation object_annotations = 14; + + // Annotations for list of logos detected, tracked and recognized in video. + repeated LogoRecognitionAnnotation logo_recognition_annotations = 19; + + // Person detection annotations. + repeated PersonDetectionAnnotation person_detection_annotations = 20; + + // Celebrity recognition annotations. + CelebrityRecognitionAnnotation celebrity_recognition_annotations = 21; + + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + google.rpc.Status error = 9; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Video file location in + // [Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Approximate percentage processed thus far. Guaranteed to be + // 100 when fully processed. + int32 progress_percent = 2; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Time of the most recent update. + google.protobuf.Timestamp update_time = 4; + + // Specifies which feature is being tracked if the request contains more than + // one feature. + Feature feature = 5; + + // Specifies which segment is being tracked if the request contains more than + // one segment. + VideoSegment segment = 6; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// Config for SPEECH_TRANSCRIPTION. +message SpeechTranscriptionConfig { + // Required. *Required* The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language Support](https://cloud.google.com/speech/docs/languages) + // for a list of the currently supported language codes. + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechTranscription`. The server may return fewer than + // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + // return a maximum of one. If omitted, will return a maximum of one. + int32 max_alternatives = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool filter_profanity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A means to provide context to assist the speech recognition. + repeated SpeechContext speech_contexts = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. The default 'false' value + // does not add punctuation to result hypotheses. NOTE: "This is currently + // offered as an experimental service, complimentary to all users. In the + // future this may be exclusively available as a premium feature." + bool enable_automatic_punctuation = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For file formats, such as MXF or MKV, supporting multiple audio + // tracks, specify up to two tracks. Default: track 0. + repeated int32 audio_tracks = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_tag provided + // in the WordInfo. + // Note: When this is true, we send all the words from the beginning of the + // audio for the top alternative in every consecutive response. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + bool enable_speaker_diarization = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, specifies the estimated number of speakers in the + // conversation. If not set, defaults to '2'. Ignored unless + // enable_speaker_diarization is set to true. + int32 diarization_speaker_count = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // Optional. A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech/limits#content). + repeated string phrases = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechTranscription { + // May contain one or more recognition hypotheses (up to the maximum specified + // in `max_alternatives`). These alternatives are ordered in terms of + // accuracy, with the top (first) alternative being the most probable, as + // ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag of the language in this result. This language code was + // detected to have the most likelihood of being spoken in the audio. + string language_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + string transcript = 1; + + // Output only. The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is set to true, you will see all + // the words from the beginning of the audio. + repeated WordInfo words = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Word-specific information for recognized words. Word information is only +// included in the response when certain request parameters are set, such +// as `enable_word_time_offsets`. +message WordInfo { + // Time offset relative to the beginning of the audio, and + // corresponding to the start of the spoken word. This field is only set if + // `enable_word_time_offsets=true` and only in the top hypothesis. This is an + // experimental feature and the accuracy of the time offset can vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, and + // corresponding to the end of the spoken word. This field is only set if + // `enable_word_time_offsets=true` and only in the top hypothesis. This is an + // experimental feature and the accuracy of the time offset can vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // Output only. The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from 1 up to diarization_speaker_count, + // and is only set if speaker diarization is enabled. + int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// Normalized bounding polygon for text (that might not be aligned with axis). +// Contains list of the corner points in clockwise order starting from +// top-left corner. For example, for a rectangular bounding box: +// When the text is horizontal it might look like: +// 0----1 +// | | +// 3----2 +// +// When it's clockwise rotated 180 degrees around the top-left corner it +// becomes: +// 2----3 +// | | +// 1----0 +// +// and the vertex order will still be (0, 1, 2, 3). Note that values can be less +// than 0, or greater than 1 due to trignometric calculations for location of +// the box. +message NormalizedBoundingPoly { + // Normalized vertices of the bounding polygon. + repeated NormalizedVertex vertices = 1; +} + +// Video segment level annotation results for text detection. +message TextSegment { + // Video segment where a text snippet was detected. + VideoSegment segment = 1; + + // Confidence for the track of detected text. It is calculated as the highest + // over all frames where OCR detected text appears. + float confidence = 2; + + // Information related to the frames where OCR detected text appears. + repeated TextFrame frames = 3; +} + +// Video frame level annotation results for text annotation (OCR). +// Contains information regarding timestamp and bounding box locations for the +// frames containing detected OCR text snippets. +message TextFrame { + // Bounding polygon of the detected text for this frame. + NormalizedBoundingPoly rotated_bounding_box = 1; + + // Timestamp of this frame. + google.protobuf.Duration time_offset = 2; +} + +// Annotations related to one detected OCR text snippet. This will contain the +// corresponding text, confidence value, and frame level information for each +// detection. +message TextAnnotation { + // The detected text. + string text = 1; + + // All video segments where OCR detected text appears. + repeated TextSegment segments = 2; +} + +// Video frame level annotations for object detection and tracking. This field +// stores per frame location, time offset, and confidence. +message ObjectTrackingFrame { + // The normalized bounding box location of this object track for the frame. + NormalizedBoundingBox normalized_bounding_box = 1; + + // The timestamp of the frame in microseconds. + google.protobuf.Duration time_offset = 2; +} + +// Annotations corresponding to one tracked object. +message ObjectTrackingAnnotation { + // Different representation of tracking info in non-streaming batch + // and streaming modes. + oneof track_info { + // Non-streaming batch mode ONLY. + // Each object track corresponds to one video segment where it appears. + VideoSegment segment = 3; + + // Streaming mode ONLY. + // In streaming mode, we do not know the end time of a tracked object + // before it is completed. Hence, there is no VideoSegment info returned. + // Instead, we provide a unique identifiable integer track_id so that + // the customers can correlate the results of the ongoing + // ObjectTrackAnnotation of the same track_id over time. + int64 track_id = 5; + } + + // Entity to specify the object category that this track is labeled as. + Entity entity = 1; + + // Object category's labeling confidence of this track. + float confidence = 4; + + // Information corresponding to all frames where this object track appears. + // Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame + // messages in frames. + // Streaming mode: it can only be one ObjectTrackingFrame message in frames. + repeated ObjectTrackingFrame frames = 2; +} + +// Annotation corresponding to one detected, tracked and recognized logo class. +message LogoRecognitionAnnotation { + // Entity category information to specify the logo class that all the logo + // tracks within this LogoRecognitionAnnotation are recognized as. + Entity entity = 1; + + // All logo tracks where the recognized logo appears. Each track corresponds + // to one logo instance appearing in consecutive frames. + repeated Track tracks = 2; + + // All video segments where the recognized logo appears. There might be + // multiple instances of the same logo class appearing in one VideoSegment. + repeated VideoSegment segments = 3; +} + +// The top-level message sent by the client for the `StreamingAnnotateVideo` +// method. Multiple `StreamingAnnotateVideoRequest` messages are sent. +// The first message must only contain a `StreamingVideoConfig` message. +// All subsequent messages must only contain `input_content` data. +message StreamingAnnotateVideoRequest { + // *Required* The streaming request, which is either a streaming config or + // video content. + oneof streaming_request { + // Provides information to the annotator, specifing how to process the + // request. The first `AnnotateStreamingVideoRequest` message must only + // contain a `video_config` message. + StreamingVideoConfig video_config = 1; + + // The video data to be annotated. Chunks of video data are sequentially + // sent in `StreamingAnnotateVideoRequest` messages. Except the initial + // `StreamingAnnotateVideoRequest` message containing only + // `video_config`, all subsequent `AnnotateStreamingVideoRequest` + // messages must only contain `input_content` field. + // Note: as with all bytes fields, protobuffers use a pure binary + // representation (not base64). + bytes input_content = 2; + } +} + +// Provides information to the annotator that specifies how to process the +// request. +message StreamingVideoConfig { + // Config for requested annotation feature. + oneof streaming_config { + // Config for STREAMING_SHOT_CHANGE_DETECTION. + StreamingShotChangeDetectionConfig shot_change_detection_config = 2; + + // Config for STREAMING_LABEL_DETECTION. + StreamingLabelDetectionConfig label_detection_config = 3; + + // Config for STREAMING_EXPLICIT_CONTENT_DETECTION. + StreamingExplicitContentDetectionConfig explicit_content_detection_config = + 4; + + // Config for STREAMING_OBJECT_TRACKING. + StreamingObjectTrackingConfig object_tracking_config = 5; + + // Config for STREAMING_AUTOML_ACTION_RECOGNITION. + StreamingAutomlActionRecognitionConfig automl_action_recognition_config = + 23; + + // Config for STREAMING_AUTOML_CLASSIFICATION. + StreamingAutomlClassificationConfig automl_classification_config = 21; + + // Config for STREAMING_AUTOML_OBJECT_TRACKING. + StreamingAutomlObjectTrackingConfig automl_object_tracking_config = 22; + } + + // Requested annotation feature. + StreamingFeature feature = 1; + + // Streaming storage option. By default: storage is disabled. + StreamingStorageConfig storage_config = 30; +} + +// `StreamingAnnotateVideoResponse` is the only message returned to the client +// by `StreamingAnnotateVideo`. A series of zero or more +// `StreamingAnnotateVideoResponse` messages are streamed back to the client. +message StreamingAnnotateVideoResponse { + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // Streaming annotation results. + StreamingVideoAnnotationResults annotation_results = 2; + + // Google Cloud Storage(GCS) URI that stores annotation results of one + // streaming session in JSON format. + // It is the annotation_result_storage_directory + // from the request followed by '/cloud_project_number-session_id'. + string annotation_results_uri = 3; +} + +// Streaming annotation results corresponding to a portion of the video +// that is currently being processed. +message StreamingVideoAnnotationResults { + // Shot annotation results. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 1; + + // Label annotation results. + repeated LabelAnnotation label_annotations = 2; + + // Explicit content annotation results. + ExplicitContentAnnotation explicit_annotation = 3; + + // Object tracking results. + repeated ObjectTrackingAnnotation object_annotations = 4; +} + +// Config for STREAMING_SHOT_CHANGE_DETECTION. +message StreamingShotChangeDetectionConfig {} + +// Config for STREAMING_LABEL_DETECTION. +message StreamingLabelDetectionConfig { + // Whether the video has been captured from a stationary (i.e. non-moving) + // camera. When set to true, might improve detection accuracy for moving + // objects. Default: false. + bool stationary_camera = 1; +} + +// Config for STREAMING_EXPLICIT_CONTENT_DETECTION. +message StreamingExplicitContentDetectionConfig {} + +// Config for STREAMING_OBJECT_TRACKING. +message StreamingObjectTrackingConfig {} + +// Config for STREAMING_AUTOML_ACTION_RECOGNITION. +message StreamingAutomlActionRecognitionConfig { + // Resource name of AutoML model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string model_name = 1; +} + +// Config for STREAMING_AUTOML_CLASSIFICATION. +message StreamingAutomlClassificationConfig { + // Resource name of AutoML model. + // Format: + // `projects/{project_number}/locations/{location_id}/models/{model_id}` + string model_name = 1; +} + +// Config for STREAMING_AUTOML_OBJECT_TRACKING. +message StreamingAutomlObjectTrackingConfig { + // Resource name of AutoML model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string model_name = 1; +} + +// Config for streaming storage option. +message StreamingStorageConfig { + // Enable streaming storage. Default: false. + bool enable_storage_annotation_result = 1; + + // Cloud Storage URI to store all annotation results for one client. Client + // should specify this field as the top-level storage directory. Annotation + // results of different sessions will be put into different sub-directories + // denoted by project_name and session_id. All sub-directories will be auto + // generated by program and will be made accessible to client in response + // proto. URIs must be specified in the following format: + // `gs://bucket-id/object-id` `bucket-id` should be a valid Cloud Storage + // bucket created by client and bucket permission shall also be configured + // properly. `object-id` can be arbitrary string that make sense to client. + // Other URI formats will return error and cause Cloud Storage write failure. + string annotation_result_storage_directory = 3; +} diff --git a/packages/google-cloud-videointelligence/protos/protos.d.ts b/packages/google-cloud-videointelligence/protos/protos.d.ts new file mode 100644 index 00000000000..3cf66ff7a8c --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/protos.d.ts @@ -0,0 +1,23784 @@ +// 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 videointelligence. */ + namespace videointelligence { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a VideoIntelligenceService */ + class VideoIntelligenceService extends $protobuf.rpc.Service { + + /** + * Constructs a new VideoIntelligenceService 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 VideoIntelligenceService 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): VideoIntelligenceService; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public annotateVideo(request: google.cloud.videointelligence.v1.IAnnotateVideoRequest, callback: google.cloud.videointelligence.v1.VideoIntelligenceService.AnnotateVideoCallback): void; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @returns Promise + */ + public annotateVideo(request: google.cloud.videointelligence.v1.IAnnotateVideoRequest): Promise; + } + + namespace VideoIntelligenceService { + + /** + * Callback as used by {@link google.cloud.videointelligence.v1.VideoIntelligenceService|annotateVideo}. + * @param error Error, if any + * @param [response] Operation + */ + type AnnotateVideoCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an AnnotateVideoRequest. */ + interface IAnnotateVideoRequest { + + /** AnnotateVideoRequest inputUri */ + inputUri?: (string|null); + + /** AnnotateVideoRequest inputContent */ + inputContent?: (Uint8Array|string|null); + + /** AnnotateVideoRequest features */ + features?: (google.cloud.videointelligence.v1.Feature[]|null); + + /** AnnotateVideoRequest videoContext */ + videoContext?: (google.cloud.videointelligence.v1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri */ + outputUri?: (string|null); + + /** AnnotateVideoRequest locationId */ + locationId?: (string|null); + } + + /** Represents an AnnotateVideoRequest. */ + class AnnotateVideoRequest implements IAnnotateVideoRequest { + + /** + * Constructs a new AnnotateVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IAnnotateVideoRequest); + + /** AnnotateVideoRequest inputUri. */ + public inputUri: string; + + /** AnnotateVideoRequest inputContent. */ + public inputContent: (Uint8Array|string); + + /** AnnotateVideoRequest features. */ + public features: google.cloud.videointelligence.v1.Feature[]; + + /** AnnotateVideoRequest videoContext. */ + public videoContext?: (google.cloud.videointelligence.v1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri. */ + public outputUri: string; + + /** AnnotateVideoRequest locationId. */ + public locationId: string; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoRequest instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IAnnotateVideoRequest): google.cloud.videointelligence.v1.AnnotateVideoRequest; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoRequest + * @throws {Error} If the payload is not 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.videointelligence.v1.AnnotateVideoRequest; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoRequest + * @throws {Error} If the payload 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.videointelligence.v1.AnnotateVideoRequest; + + /** + * Verifies an AnnotateVideoRequest message. + * @param message Plain 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 AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.AnnotateVideoRequest; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @param message AnnotateVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.AnnotateVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoContext. */ + interface IVideoContext { + + /** VideoContext segments */ + segments?: (google.cloud.videointelligence.v1.IVideoSegment[]|null); + + /** VideoContext labelDetectionConfig */ + labelDetectionConfig?: (google.cloud.videointelligence.v1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig */ + shotChangeDetectionConfig?: (google.cloud.videointelligence.v1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig */ + explicitContentDetectionConfig?: (google.cloud.videointelligence.v1.IExplicitContentDetectionConfig|null); + + /** VideoContext faceDetectionConfig */ + faceDetectionConfig?: (google.cloud.videointelligence.v1.IFaceDetectionConfig|null); + + /** VideoContext speechTranscriptionConfig */ + speechTranscriptionConfig?: (google.cloud.videointelligence.v1.ISpeechTranscriptionConfig|null); + + /** VideoContext textDetectionConfig */ + textDetectionConfig?: (google.cloud.videointelligence.v1.ITextDetectionConfig|null); + + /** VideoContext personDetectionConfig */ + personDetectionConfig?: (google.cloud.videointelligence.v1.IPersonDetectionConfig|null); + + /** VideoContext objectTrackingConfig */ + objectTrackingConfig?: (google.cloud.videointelligence.v1.IObjectTrackingConfig|null); + } + + /** Represents a VideoContext. */ + class VideoContext implements IVideoContext { + + /** + * Constructs a new VideoContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IVideoContext); + + /** VideoContext segments. */ + public segments: google.cloud.videointelligence.v1.IVideoSegment[]; + + /** VideoContext labelDetectionConfig. */ + public labelDetectionConfig?: (google.cloud.videointelligence.v1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig. */ + public shotChangeDetectionConfig?: (google.cloud.videointelligence.v1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig. */ + public explicitContentDetectionConfig?: (google.cloud.videointelligence.v1.IExplicitContentDetectionConfig|null); + + /** VideoContext faceDetectionConfig. */ + public faceDetectionConfig?: (google.cloud.videointelligence.v1.IFaceDetectionConfig|null); + + /** VideoContext speechTranscriptionConfig. */ + public speechTranscriptionConfig?: (google.cloud.videointelligence.v1.ISpeechTranscriptionConfig|null); + + /** VideoContext textDetectionConfig. */ + public textDetectionConfig?: (google.cloud.videointelligence.v1.ITextDetectionConfig|null); + + /** VideoContext personDetectionConfig. */ + public personDetectionConfig?: (google.cloud.videointelligence.v1.IPersonDetectionConfig|null); + + /** VideoContext objectTrackingConfig. */ + public objectTrackingConfig?: (google.cloud.videointelligence.v1.IObjectTrackingConfig|null); + + /** + * Creates a new VideoContext instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IVideoContext): google.cloud.videointelligence.v1.VideoContext; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoContext + * @throws {Error} If the payload is not 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.videointelligence.v1.VideoContext; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoContext + * @throws {Error} If the payload 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.videointelligence.v1.VideoContext; + + /** + * Verifies a VideoContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.VideoContext; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @param message VideoContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.VideoContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + LABEL_DETECTION = 1, + SHOT_CHANGE_DETECTION = 2, + EXPLICIT_CONTENT_DETECTION = 3, + FACE_DETECTION = 4, + SPEECH_TRANSCRIPTION = 6, + TEXT_DETECTION = 7, + OBJECT_TRACKING = 9, + LOGO_RECOGNITION = 12, + PERSON_DETECTION = 14 + } + + /** LabelDetectionMode enum. */ + enum LabelDetectionMode { + LABEL_DETECTION_MODE_UNSPECIFIED = 0, + SHOT_MODE = 1, + FRAME_MODE = 2, + SHOT_AND_FRAME_MODE = 3 + } + + /** Likelihood enum. */ + enum Likelihood { + LIKELIHOOD_UNSPECIFIED = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of a LabelDetectionConfig. */ + interface ILabelDetectionConfig { + + /** LabelDetectionConfig labelDetectionMode */ + labelDetectionMode?: (google.cloud.videointelligence.v1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1.LabelDetectionMode|null); + + /** LabelDetectionConfig stationaryCamera */ + stationaryCamera?: (boolean|null); + + /** LabelDetectionConfig model */ + model?: (string|null); + + /** LabelDetectionConfig frameConfidenceThreshold */ + frameConfidenceThreshold?: (number|null); + + /** LabelDetectionConfig videoConfidenceThreshold */ + videoConfidenceThreshold?: (number|null); + } + + /** Represents a LabelDetectionConfig. */ + class LabelDetectionConfig implements ILabelDetectionConfig { + + /** + * Constructs a new LabelDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ILabelDetectionConfig); + + /** LabelDetectionConfig labelDetectionMode. */ + public labelDetectionMode: (google.cloud.videointelligence.v1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1.LabelDetectionMode); + + /** LabelDetectionConfig stationaryCamera. */ + public stationaryCamera: boolean; + + /** LabelDetectionConfig model. */ + public model: string; + + /** LabelDetectionConfig frameConfidenceThreshold. */ + public frameConfidenceThreshold: number; + + /** LabelDetectionConfig videoConfidenceThreshold. */ + public videoConfidenceThreshold: number; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ILabelDetectionConfig): google.cloud.videointelligence.v1.LabelDetectionConfig; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.LabelDetectionConfig; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1.LabelDetectionConfig; + + /** + * Verifies a LabelDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.LabelDetectionConfig; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @param message LabelDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.LabelDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShotChangeDetectionConfig. */ + interface IShotChangeDetectionConfig { + + /** ShotChangeDetectionConfig model */ + model?: (string|null); + } + + /** Represents a ShotChangeDetectionConfig. */ + class ShotChangeDetectionConfig implements IShotChangeDetectionConfig { + + /** + * Constructs a new ShotChangeDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IShotChangeDetectionConfig); + + /** ShotChangeDetectionConfig model. */ + public model: string; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShotChangeDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IShotChangeDetectionConfig): google.cloud.videointelligence.v1.ShotChangeDetectionConfig; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.ShotChangeDetectionConfig; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1.ShotChangeDetectionConfig; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShotChangeDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ShotChangeDetectionConfig; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @param message ShotChangeDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ShotChangeDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingConfig. */ + interface IObjectTrackingConfig { + + /** ObjectTrackingConfig model */ + model?: (string|null); + } + + /** Represents an ObjectTrackingConfig. */ + class ObjectTrackingConfig implements IObjectTrackingConfig { + + /** + * Constructs a new ObjectTrackingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IObjectTrackingConfig); + + /** ObjectTrackingConfig model. */ + public model: string; + + /** + * Creates a new ObjectTrackingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IObjectTrackingConfig): google.cloud.videointelligence.v1.ObjectTrackingConfig; + + /** + * Encodes the specified ObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingConfig.verify|verify} messages. + * @param message ObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingConfig.verify|verify} messages. + * @param message ObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.ObjectTrackingConfig; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingConfig + * @throws {Error} If the payload 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.videointelligence.v1.ObjectTrackingConfig; + + /** + * Verifies an ObjectTrackingConfig message. + * @param message Plain 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 ObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ObjectTrackingConfig; + + /** + * Creates a plain object from an ObjectTrackingConfig message. Also converts values to other types if specified. + * @param message ObjectTrackingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ObjectTrackingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceDetectionConfig. */ + interface IFaceDetectionConfig { + + /** FaceDetectionConfig model */ + model?: (string|null); + + /** FaceDetectionConfig includeBoundingBoxes */ + includeBoundingBoxes?: (boolean|null); + + /** FaceDetectionConfig includeAttributes */ + includeAttributes?: (boolean|null); + } + + /** Represents a FaceDetectionConfig. */ + class FaceDetectionConfig implements IFaceDetectionConfig { + + /** + * Constructs a new FaceDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IFaceDetectionConfig); + + /** FaceDetectionConfig model. */ + public model: string; + + /** FaceDetectionConfig includeBoundingBoxes. */ + public includeBoundingBoxes: boolean; + + /** FaceDetectionConfig includeAttributes. */ + public includeAttributes: boolean; + + /** + * Creates a new FaceDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IFaceDetectionConfig): google.cloud.videointelligence.v1.FaceDetectionConfig; + + /** + * Encodes the specified FaceDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionConfig.verify|verify} messages. + * @param message FaceDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IFaceDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionConfig.verify|verify} messages. + * @param message FaceDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IFaceDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.FaceDetectionConfig; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1.FaceDetectionConfig; + + /** + * Verifies a FaceDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.FaceDetectionConfig; + + /** + * Creates a plain object from a FaceDetectionConfig message. Also converts values to other types if specified. + * @param message FaceDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.FaceDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonDetectionConfig. */ + interface IPersonDetectionConfig { + + /** PersonDetectionConfig includeBoundingBoxes */ + includeBoundingBoxes?: (boolean|null); + + /** PersonDetectionConfig includePoseLandmarks */ + includePoseLandmarks?: (boolean|null); + + /** PersonDetectionConfig includeAttributes */ + includeAttributes?: (boolean|null); + } + + /** Represents a PersonDetectionConfig. */ + class PersonDetectionConfig implements IPersonDetectionConfig { + + /** + * Constructs a new PersonDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IPersonDetectionConfig); + + /** PersonDetectionConfig includeBoundingBoxes. */ + public includeBoundingBoxes: boolean; + + /** PersonDetectionConfig includePoseLandmarks. */ + public includePoseLandmarks: boolean; + + /** PersonDetectionConfig includeAttributes. */ + public includeAttributes: boolean; + + /** + * Creates a new PersonDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IPersonDetectionConfig): google.cloud.videointelligence.v1.PersonDetectionConfig; + + /** + * Encodes the specified PersonDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionConfig.verify|verify} messages. + * @param message PersonDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IPersonDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionConfig.verify|verify} messages. + * @param message PersonDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IPersonDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.PersonDetectionConfig; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1.PersonDetectionConfig; + + /** + * Verifies a PersonDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.PersonDetectionConfig; + + /** + * Creates a plain object from a PersonDetectionConfig message. Also converts values to other types if specified. + * @param message PersonDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.PersonDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentDetectionConfig. */ + interface IExplicitContentDetectionConfig { + + /** ExplicitContentDetectionConfig model */ + model?: (string|null); + } + + /** Represents an ExplicitContentDetectionConfig. */ + class ExplicitContentDetectionConfig implements IExplicitContentDetectionConfig { + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IExplicitContentDetectionConfig); + + /** ExplicitContentDetectionConfig model. */ + public model: string; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IExplicitContentDetectionConfig): google.cloud.videointelligence.v1.ExplicitContentDetectionConfig; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.ExplicitContentDetectionConfig; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1.ExplicitContentDetectionConfig; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @param message Plain 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 ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ExplicitContentDetectionConfig; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @param message ExplicitContentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ExplicitContentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextDetectionConfig. */ + interface ITextDetectionConfig { + + /** TextDetectionConfig languageHints */ + languageHints?: (string[]|null); + + /** TextDetectionConfig model */ + model?: (string|null); + } + + /** Represents a TextDetectionConfig. */ + class TextDetectionConfig implements ITextDetectionConfig { + + /** + * Constructs a new TextDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ITextDetectionConfig); + + /** TextDetectionConfig languageHints. */ + public languageHints: string[]; + + /** TextDetectionConfig model. */ + public model: string; + + /** + * Creates a new TextDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ITextDetectionConfig): google.cloud.videointelligence.v1.TextDetectionConfig; + + /** + * Encodes the specified TextDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.TextDetectionConfig.verify|verify} messages. + * @param message TextDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ITextDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextDetectionConfig.verify|verify} messages. + * @param message TextDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ITextDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.TextDetectionConfig; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1.TextDetectionConfig; + + /** + * Verifies a TextDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.TextDetectionConfig; + + /** + * Creates a plain object from a TextDetectionConfig message. Also converts values to other types if specified. + * @param message TextDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.TextDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoSegment. */ + interface IVideoSegment { + + /** VideoSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoSegment. */ + class VideoSegment implements IVideoSegment { + + /** + * Constructs a new VideoSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IVideoSegment); + + /** VideoSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IVideoSegment): google.cloud.videointelligence.v1.VideoSegment; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoSegment + * @throws {Error} If the payload is not 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.videointelligence.v1.VideoSegment; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoSegment + * @throws {Error} If the payload 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.videointelligence.v1.VideoSegment; + + /** + * Verifies a VideoSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.VideoSegment; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @param message VideoSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.VideoSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelSegment. */ + interface ILabelSegment { + + /** LabelSegment segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** LabelSegment confidence */ + confidence?: (number|null); + } + + /** Represents a LabelSegment. */ + class LabelSegment implements ILabelSegment { + + /** + * Constructs a new LabelSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ILabelSegment); + + /** LabelSegment segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** LabelSegment confidence. */ + public confidence: number; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ILabelSegment): google.cloud.videointelligence.v1.LabelSegment; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSegment + * @throws {Error} If the payload is not 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.videointelligence.v1.LabelSegment; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSegment + * @throws {Error} If the payload 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.videointelligence.v1.LabelSegment; + + /** + * Verifies a LabelSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.LabelSegment; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @param message LabelSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.LabelSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelFrame. */ + interface ILabelFrame { + + /** LabelFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence */ + confidence?: (number|null); + } + + /** Represents a LabelFrame. */ + class LabelFrame implements ILabelFrame { + + /** + * Constructs a new LabelFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ILabelFrame); + + /** LabelFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence. */ + public confidence: number; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ILabelFrame): google.cloud.videointelligence.v1.LabelFrame; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelFrame + * @throws {Error} If the payload is not 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.videointelligence.v1.LabelFrame; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelFrame + * @throws {Error} If the payload 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.videointelligence.v1.LabelFrame; + + /** + * Verifies a LabelFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.LabelFrame; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @param message LabelFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.LabelFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity entityId */ + entityId?: (string|null); + + /** Entity description */ + description?: (string|null); + + /** Entity languageCode */ + languageCode?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IEntity); + + /** Entity entityId. */ + public entityId: string; + + /** Entity description. */ + public description: string; + + /** Entity languageCode. */ + public languageCode: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IEntity): google.cloud.videointelligence.v1.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not 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.videointelligence.v1.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload 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.videointelligence.v1.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelAnnotation. */ + interface ILabelAnnotation { + + /** LabelAnnotation entity */ + entity?: (google.cloud.videointelligence.v1.IEntity|null); + + /** LabelAnnotation categoryEntities */ + categoryEntities?: (google.cloud.videointelligence.v1.IEntity[]|null); + + /** LabelAnnotation segments */ + segments?: (google.cloud.videointelligence.v1.ILabelSegment[]|null); + + /** LabelAnnotation frames */ + frames?: (google.cloud.videointelligence.v1.ILabelFrame[]|null); + + /** LabelAnnotation version */ + version?: (string|null); + } + + /** Represents a LabelAnnotation. */ + class LabelAnnotation implements ILabelAnnotation { + + /** + * Constructs a new LabelAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ILabelAnnotation); + + /** LabelAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1.IEntity|null); + + /** LabelAnnotation categoryEntities. */ + public categoryEntities: google.cloud.videointelligence.v1.IEntity[]; + + /** LabelAnnotation segments. */ + public segments: google.cloud.videointelligence.v1.ILabelSegment[]; + + /** LabelAnnotation frames. */ + public frames: google.cloud.videointelligence.v1.ILabelFrame[]; + + /** LabelAnnotation version. */ + public version: string; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ILabelAnnotation): google.cloud.videointelligence.v1.LabelAnnotation; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.LabelAnnotation; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.LabelAnnotation; + + /** + * Verifies a LabelAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.LabelAnnotation; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @param message LabelAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.LabelAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentFrame. */ + interface IExplicitContentFrame { + + /** ExplicitContentFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood */ + pornographyLikelihood?: (google.cloud.videointelligence.v1.Likelihood|keyof typeof google.cloud.videointelligence.v1.Likelihood|null); + } + + /** Represents an ExplicitContentFrame. */ + class ExplicitContentFrame implements IExplicitContentFrame { + + /** + * Constructs a new ExplicitContentFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IExplicitContentFrame); + + /** ExplicitContentFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood. */ + public pornographyLikelihood: (google.cloud.videointelligence.v1.Likelihood|keyof typeof google.cloud.videointelligence.v1.Likelihood); + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IExplicitContentFrame): google.cloud.videointelligence.v1.ExplicitContentFrame; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentFrame + * @throws {Error} If the payload is not 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.videointelligence.v1.ExplicitContentFrame; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentFrame + * @throws {Error} If the payload 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.videointelligence.v1.ExplicitContentFrame; + + /** + * Verifies an ExplicitContentFrame message. + * @param message Plain 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 ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ExplicitContentFrame; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @param message ExplicitContentFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ExplicitContentFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentAnnotation. */ + interface IExplicitContentAnnotation { + + /** ExplicitContentAnnotation frames */ + frames?: (google.cloud.videointelligence.v1.IExplicitContentFrame[]|null); + + /** ExplicitContentAnnotation version */ + version?: (string|null); + } + + /** Represents an ExplicitContentAnnotation. */ + class ExplicitContentAnnotation implements IExplicitContentAnnotation { + + /** + * Constructs a new ExplicitContentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IExplicitContentAnnotation); + + /** ExplicitContentAnnotation frames. */ + public frames: google.cloud.videointelligence.v1.IExplicitContentFrame[]; + + /** ExplicitContentAnnotation version. */ + public version: string; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IExplicitContentAnnotation): google.cloud.videointelligence.v1.ExplicitContentAnnotation; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.ExplicitContentAnnotation; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.ExplicitContentAnnotation; + + /** + * Verifies an ExplicitContentAnnotation message. + * @param message Plain 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 ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ExplicitContentAnnotation; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @param message ExplicitContentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ExplicitContentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox left */ + left?: (number|null); + + /** NormalizedBoundingBox top */ + top?: (number|null); + + /** NormalizedBoundingBox right */ + right?: (number|null); + + /** NormalizedBoundingBox bottom */ + bottom?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.INormalizedBoundingBox); + + /** NormalizedBoundingBox left. */ + public left: number; + + /** NormalizedBoundingBox top. */ + public top: number; + + /** NormalizedBoundingBox right. */ + public right: number; + + /** NormalizedBoundingBox bottom. */ + public bottom: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.videointelligence.v1.INormalizedBoundingBox): google.cloud.videointelligence.v1.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not 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.videointelligence.v1.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload 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.videointelligence.v1.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceDetectionAnnotation. */ + interface IFaceDetectionAnnotation { + + /** FaceDetectionAnnotation tracks */ + tracks?: (google.cloud.videointelligence.v1.ITrack[]|null); + + /** FaceDetectionAnnotation thumbnail */ + thumbnail?: (Uint8Array|string|null); + + /** FaceDetectionAnnotation version */ + version?: (string|null); + } + + /** Represents a FaceDetectionAnnotation. */ + class FaceDetectionAnnotation implements IFaceDetectionAnnotation { + + /** + * Constructs a new FaceDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IFaceDetectionAnnotation); + + /** FaceDetectionAnnotation tracks. */ + public tracks: google.cloud.videointelligence.v1.ITrack[]; + + /** FaceDetectionAnnotation thumbnail. */ + public thumbnail: (Uint8Array|string); + + /** FaceDetectionAnnotation version. */ + public version: string; + + /** + * Creates a new FaceDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceDetectionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IFaceDetectionAnnotation): google.cloud.videointelligence.v1.FaceDetectionAnnotation; + + /** + * Encodes the specified FaceDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionAnnotation.verify|verify} messages. + * @param message FaceDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IFaceDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionAnnotation.verify|verify} messages. + * @param message FaceDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IFaceDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceDetectionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.FaceDetectionAnnotation; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceDetectionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.FaceDetectionAnnotation; + + /** + * Verifies a FaceDetectionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.FaceDetectionAnnotation; + + /** + * Creates a plain object from a FaceDetectionAnnotation message. Also converts values to other types if specified. + * @param message FaceDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.FaceDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonDetectionAnnotation. */ + interface IPersonDetectionAnnotation { + + /** PersonDetectionAnnotation tracks */ + tracks?: (google.cloud.videointelligence.v1.ITrack[]|null); + + /** PersonDetectionAnnotation version */ + version?: (string|null); + } + + /** Represents a PersonDetectionAnnotation. */ + class PersonDetectionAnnotation implements IPersonDetectionAnnotation { + + /** + * Constructs a new PersonDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IPersonDetectionAnnotation); + + /** PersonDetectionAnnotation tracks. */ + public tracks: google.cloud.videointelligence.v1.ITrack[]; + + /** PersonDetectionAnnotation version. */ + public version: string; + + /** + * Creates a new PersonDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonDetectionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IPersonDetectionAnnotation): google.cloud.videointelligence.v1.PersonDetectionAnnotation; + + /** + * Encodes the specified PersonDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionAnnotation.verify|verify} messages. + * @param message PersonDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IPersonDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionAnnotation.verify|verify} messages. + * @param message PersonDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IPersonDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonDetectionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.PersonDetectionAnnotation; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonDetectionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.PersonDetectionAnnotation; + + /** + * Verifies a PersonDetectionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.PersonDetectionAnnotation; + + /** + * Creates a plain object from a PersonDetectionAnnotation message. Also converts values to other types if specified. + * @param message PersonDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.PersonDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceSegment. */ + interface IFaceSegment { + + /** FaceSegment segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + } + + /** Represents a FaceSegment. */ + class FaceSegment implements IFaceSegment { + + /** + * Constructs a new FaceSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IFaceSegment); + + /** FaceSegment segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** + * Creates a new FaceSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IFaceSegment): google.cloud.videointelligence.v1.FaceSegment; + + /** + * Encodes the specified FaceSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceSegment.verify|verify} messages. + * @param message FaceSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IFaceSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceSegment.verify|verify} messages. + * @param message FaceSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IFaceSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceSegment + * @throws {Error} If the payload is not 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.videointelligence.v1.FaceSegment; + + /** + * Decodes a FaceSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceSegment + * @throws {Error} If the payload 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.videointelligence.v1.FaceSegment; + + /** + * Verifies a FaceSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.FaceSegment; + + /** + * Creates a plain object from a FaceSegment message. Also converts values to other types if specified. + * @param message FaceSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.FaceSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceFrame. */ + interface IFaceFrame { + + /** FaceFrame normalizedBoundingBoxes */ + normalizedBoundingBoxes?: (google.cloud.videointelligence.v1.INormalizedBoundingBox[]|null); + + /** FaceFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a FaceFrame. */ + class FaceFrame implements IFaceFrame { + + /** + * Constructs a new FaceFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IFaceFrame); + + /** FaceFrame normalizedBoundingBoxes. */ + public normalizedBoundingBoxes: google.cloud.videointelligence.v1.INormalizedBoundingBox[]; + + /** FaceFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new FaceFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IFaceFrame): google.cloud.videointelligence.v1.FaceFrame; + + /** + * Encodes the specified FaceFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceFrame.verify|verify} messages. + * @param message FaceFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IFaceFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceFrame.verify|verify} messages. + * @param message FaceFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IFaceFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceFrame + * @throws {Error} If the payload is not 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.videointelligence.v1.FaceFrame; + + /** + * Decodes a FaceFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceFrame + * @throws {Error} If the payload 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.videointelligence.v1.FaceFrame; + + /** + * Verifies a FaceFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.FaceFrame; + + /** + * Creates a plain object from a FaceFrame message. Also converts values to other types if specified. + * @param message FaceFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.FaceFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation thumbnail */ + thumbnail?: (Uint8Array|string|null); + + /** FaceAnnotation segments */ + segments?: (google.cloud.videointelligence.v1.IFaceSegment[]|null); + + /** FaceAnnotation frames */ + frames?: (google.cloud.videointelligence.v1.IFaceFrame[]|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IFaceAnnotation); + + /** FaceAnnotation thumbnail. */ + public thumbnail: (Uint8Array|string); + + /** FaceAnnotation segments. */ + public segments: google.cloud.videointelligence.v1.IFaceSegment[]; + + /** FaceAnnotation frames. */ + public frames: google.cloud.videointelligence.v1.IFaceFrame[]; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IFaceAnnotation): google.cloud.videointelligence.v1.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampedObject. */ + interface ITimestampedObject { + + /** TimestampedObject normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.videointelligence.v1.INormalizedBoundingBox|null); + + /** TimestampedObject timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** TimestampedObject attributes */ + attributes?: (google.cloud.videointelligence.v1.IDetectedAttribute[]|null); + + /** TimestampedObject landmarks */ + landmarks?: (google.cloud.videointelligence.v1.IDetectedLandmark[]|null); + } + + /** Represents a TimestampedObject. */ + class TimestampedObject implements ITimestampedObject { + + /** + * Constructs a new TimestampedObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ITimestampedObject); + + /** TimestampedObject normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.videointelligence.v1.INormalizedBoundingBox|null); + + /** TimestampedObject timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** TimestampedObject attributes. */ + public attributes: google.cloud.videointelligence.v1.IDetectedAttribute[]; + + /** TimestampedObject landmarks. */ + public landmarks: google.cloud.videointelligence.v1.IDetectedLandmark[]; + + /** + * Creates a new TimestampedObject instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampedObject instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ITimestampedObject): google.cloud.videointelligence.v1.TimestampedObject; + + /** + * Encodes the specified TimestampedObject message. Does not implicitly {@link google.cloud.videointelligence.v1.TimestampedObject.verify|verify} messages. + * @param message TimestampedObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ITimestampedObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampedObject message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TimestampedObject.verify|verify} messages. + * @param message TimestampedObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ITimestampedObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampedObject + * @throws {Error} If the payload is not 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.videointelligence.v1.TimestampedObject; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampedObject + * @throws {Error} If the payload 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.videointelligence.v1.TimestampedObject; + + /** + * Verifies a TimestampedObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampedObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampedObject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.TimestampedObject; + + /** + * Creates a plain object from a TimestampedObject message. Also converts values to other types if specified. + * @param message TimestampedObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.TimestampedObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampedObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampedObject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Track. */ + interface ITrack { + + /** Track segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** Track timestampedObjects */ + timestampedObjects?: (google.cloud.videointelligence.v1.ITimestampedObject[]|null); + + /** Track attributes */ + attributes?: (google.cloud.videointelligence.v1.IDetectedAttribute[]|null); + + /** Track confidence */ + confidence?: (number|null); + } + + /** Represents a Track. */ + class Track implements ITrack { + + /** + * Constructs a new Track. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ITrack); + + /** Track segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** Track timestampedObjects. */ + public timestampedObjects: google.cloud.videointelligence.v1.ITimestampedObject[]; + + /** Track attributes. */ + public attributes: google.cloud.videointelligence.v1.IDetectedAttribute[]; + + /** Track confidence. */ + public confidence: number; + + /** + * Creates a new Track instance using the specified properties. + * @param [properties] Properties to set + * @returns Track instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ITrack): google.cloud.videointelligence.v1.Track; + + /** + * Encodes the specified Track message. Does not implicitly {@link google.cloud.videointelligence.v1.Track.verify|verify} messages. + * @param message Track message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ITrack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Track message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.Track.verify|verify} messages. + * @param message Track message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ITrack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Track message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Track + * @throws {Error} If the payload is not 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.videointelligence.v1.Track; + + /** + * Decodes a Track message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Track + * @throws {Error} If the payload 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.videointelligence.v1.Track; + + /** + * Verifies a Track message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Track message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Track + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.Track; + + /** + * Creates a plain object from a Track message. Also converts values to other types if specified. + * @param message Track + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.Track, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Track to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Track + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedAttribute. */ + interface IDetectedAttribute { + + /** DetectedAttribute name */ + name?: (string|null); + + /** DetectedAttribute confidence */ + confidence?: (number|null); + + /** DetectedAttribute value */ + value?: (string|null); + } + + /** Represents a DetectedAttribute. */ + class DetectedAttribute implements IDetectedAttribute { + + /** + * Constructs a new DetectedAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IDetectedAttribute); + + /** DetectedAttribute name. */ + public name: string; + + /** DetectedAttribute confidence. */ + public confidence: number; + + /** DetectedAttribute value. */ + public value: string; + + /** + * Creates a new DetectedAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedAttribute instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IDetectedAttribute): google.cloud.videointelligence.v1.DetectedAttribute; + + /** + * Encodes the specified DetectedAttribute message. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedAttribute.verify|verify} messages. + * @param message DetectedAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IDetectedAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedAttribute message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedAttribute.verify|verify} messages. + * @param message DetectedAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IDetectedAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedAttribute + * @throws {Error} If the payload is not 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.videointelligence.v1.DetectedAttribute; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedAttribute + * @throws {Error} If the payload 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.videointelligence.v1.DetectedAttribute; + + /** + * Verifies a DetectedAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.DetectedAttribute; + + /** + * Creates a plain object from a DetectedAttribute message. Also converts values to other types if specified. + * @param message DetectedAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.DetectedAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedLandmark. */ + interface IDetectedLandmark { + + /** DetectedLandmark name */ + name?: (string|null); + + /** DetectedLandmark point */ + point?: (google.cloud.videointelligence.v1.INormalizedVertex|null); + + /** DetectedLandmark confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLandmark. */ + class DetectedLandmark implements IDetectedLandmark { + + /** + * Constructs a new DetectedLandmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IDetectedLandmark); + + /** DetectedLandmark name. */ + public name: string; + + /** DetectedLandmark point. */ + public point?: (google.cloud.videointelligence.v1.INormalizedVertex|null); + + /** DetectedLandmark confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLandmark instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLandmark instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IDetectedLandmark): google.cloud.videointelligence.v1.DetectedLandmark; + + /** + * Encodes the specified DetectedLandmark message. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedLandmark.verify|verify} messages. + * @param message DetectedLandmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IDetectedLandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLandmark message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedLandmark.verify|verify} messages. + * @param message DetectedLandmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IDetectedLandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLandmark + * @throws {Error} If the payload is not 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.videointelligence.v1.DetectedLandmark; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLandmark + * @throws {Error} If the payload 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.videointelligence.v1.DetectedLandmark; + + /** + * Verifies a DetectedLandmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLandmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLandmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.DetectedLandmark; + + /** + * Creates a plain object from a DetectedLandmark message. Also converts values to other types if specified. + * @param message DetectedLandmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.DetectedLandmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLandmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedLandmark + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationResults. */ + interface IVideoAnnotationResults { + + /** VideoAnnotationResults inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationResults segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** VideoAnnotationResults segmentLabelAnnotations */ + segmentLabelAnnotations?: (google.cloud.videointelligence.v1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults segmentPresenceLabelAnnotations */ + segmentPresenceLabelAnnotations?: (google.cloud.videointelligence.v1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotLabelAnnotations */ + shotLabelAnnotations?: (google.cloud.videointelligence.v1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotPresenceLabelAnnotations */ + shotPresenceLabelAnnotations?: (google.cloud.videointelligence.v1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults frameLabelAnnotations */ + frameLabelAnnotations?: (google.cloud.videointelligence.v1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults faceAnnotations */ + faceAnnotations?: (google.cloud.videointelligence.v1.IFaceAnnotation[]|null); + + /** VideoAnnotationResults faceDetectionAnnotations */ + faceDetectionAnnotations?: (google.cloud.videointelligence.v1.IFaceDetectionAnnotation[]|null); + + /** VideoAnnotationResults shotAnnotations */ + shotAnnotations?: (google.cloud.videointelligence.v1.IVideoSegment[]|null); + + /** VideoAnnotationResults explicitAnnotation */ + explicitAnnotation?: (google.cloud.videointelligence.v1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults speechTranscriptions */ + speechTranscriptions?: (google.cloud.videointelligence.v1.ISpeechTranscription[]|null); + + /** VideoAnnotationResults textAnnotations */ + textAnnotations?: (google.cloud.videointelligence.v1.ITextAnnotation[]|null); + + /** VideoAnnotationResults objectAnnotations */ + objectAnnotations?: (google.cloud.videointelligence.v1.IObjectTrackingAnnotation[]|null); + + /** VideoAnnotationResults logoRecognitionAnnotations */ + logoRecognitionAnnotations?: (google.cloud.videointelligence.v1.ILogoRecognitionAnnotation[]|null); + + /** VideoAnnotationResults personDetectionAnnotations */ + personDetectionAnnotations?: (google.cloud.videointelligence.v1.IPersonDetectionAnnotation[]|null); + + /** VideoAnnotationResults error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a VideoAnnotationResults. */ + class VideoAnnotationResults implements IVideoAnnotationResults { + + /** + * Constructs a new VideoAnnotationResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IVideoAnnotationResults); + + /** VideoAnnotationResults inputUri. */ + public inputUri: string; + + /** VideoAnnotationResults segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** VideoAnnotationResults segmentLabelAnnotations. */ + public segmentLabelAnnotations: google.cloud.videointelligence.v1.ILabelAnnotation[]; + + /** VideoAnnotationResults segmentPresenceLabelAnnotations. */ + public segmentPresenceLabelAnnotations: google.cloud.videointelligence.v1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotLabelAnnotations. */ + public shotLabelAnnotations: google.cloud.videointelligence.v1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotPresenceLabelAnnotations. */ + public shotPresenceLabelAnnotations: google.cloud.videointelligence.v1.ILabelAnnotation[]; + + /** VideoAnnotationResults frameLabelAnnotations. */ + public frameLabelAnnotations: google.cloud.videointelligence.v1.ILabelAnnotation[]; + + /** VideoAnnotationResults faceAnnotations. */ + public faceAnnotations: google.cloud.videointelligence.v1.IFaceAnnotation[]; + + /** VideoAnnotationResults faceDetectionAnnotations. */ + public faceDetectionAnnotations: google.cloud.videointelligence.v1.IFaceDetectionAnnotation[]; + + /** VideoAnnotationResults shotAnnotations. */ + public shotAnnotations: google.cloud.videointelligence.v1.IVideoSegment[]; + + /** VideoAnnotationResults explicitAnnotation. */ + public explicitAnnotation?: (google.cloud.videointelligence.v1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults speechTranscriptions. */ + public speechTranscriptions: google.cloud.videointelligence.v1.ISpeechTranscription[]; + + /** VideoAnnotationResults textAnnotations. */ + public textAnnotations: google.cloud.videointelligence.v1.ITextAnnotation[]; + + /** VideoAnnotationResults objectAnnotations. */ + public objectAnnotations: google.cloud.videointelligence.v1.IObjectTrackingAnnotation[]; + + /** VideoAnnotationResults logoRecognitionAnnotations. */ + public logoRecognitionAnnotations: google.cloud.videointelligence.v1.ILogoRecognitionAnnotation[]; + + /** VideoAnnotationResults personDetectionAnnotations. */ + public personDetectionAnnotations: google.cloud.videointelligence.v1.IPersonDetectionAnnotation[]; + + /** VideoAnnotationResults error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationResults instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IVideoAnnotationResults): google.cloud.videointelligence.v1.VideoAnnotationResults; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationResults + * @throws {Error} If the payload is not 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.videointelligence.v1.VideoAnnotationResults; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationResults + * @throws {Error} If the payload 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.videointelligence.v1.VideoAnnotationResults; + + /** + * Verifies a VideoAnnotationResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.VideoAnnotationResults; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @param message VideoAnnotationResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.VideoAnnotationResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoResponse. */ + interface IAnnotateVideoResponse { + + /** AnnotateVideoResponse annotationResults */ + annotationResults?: (google.cloud.videointelligence.v1.IVideoAnnotationResults[]|null); + } + + /** Represents an AnnotateVideoResponse. */ + class AnnotateVideoResponse implements IAnnotateVideoResponse { + + /** + * Constructs a new AnnotateVideoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IAnnotateVideoResponse); + + /** AnnotateVideoResponse annotationResults. */ + public annotationResults: google.cloud.videointelligence.v1.IVideoAnnotationResults[]; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoResponse instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IAnnotateVideoResponse): google.cloud.videointelligence.v1.AnnotateVideoResponse; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoResponse + * @throws {Error} If the payload is not 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.videointelligence.v1.AnnotateVideoResponse; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoResponse + * @throws {Error} If the payload 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.videointelligence.v1.AnnotateVideoResponse; + + /** + * Verifies an AnnotateVideoResponse message. + * @param message Plain 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 AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.AnnotateVideoResponse; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @param message AnnotateVideoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.AnnotateVideoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationProgress. */ + interface IVideoAnnotationProgress { + + /** VideoAnnotationProgress inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationProgress progressPercent */ + progressPercent?: (number|null); + + /** VideoAnnotationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress feature */ + feature?: (google.cloud.videointelligence.v1.Feature|keyof typeof google.cloud.videointelligence.v1.Feature|null); + + /** VideoAnnotationProgress segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + } + + /** Represents a VideoAnnotationProgress. */ + class VideoAnnotationProgress implements IVideoAnnotationProgress { + + /** + * Constructs a new VideoAnnotationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IVideoAnnotationProgress); + + /** VideoAnnotationProgress inputUri. */ + public inputUri: string; + + /** VideoAnnotationProgress progressPercent. */ + public progressPercent: number; + + /** VideoAnnotationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress feature. */ + public feature: (google.cloud.videointelligence.v1.Feature|keyof typeof google.cloud.videointelligence.v1.Feature); + + /** VideoAnnotationProgress segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IVideoAnnotationProgress): google.cloud.videointelligence.v1.VideoAnnotationProgress; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationProgress + * @throws {Error} If the payload is not 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.videointelligence.v1.VideoAnnotationProgress; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationProgress + * @throws {Error} If the payload 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.videointelligence.v1.VideoAnnotationProgress; + + /** + * Verifies a VideoAnnotationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.VideoAnnotationProgress; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @param message VideoAnnotationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.VideoAnnotationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoProgress. */ + interface IAnnotateVideoProgress { + + /** AnnotateVideoProgress annotationProgress */ + annotationProgress?: (google.cloud.videointelligence.v1.IVideoAnnotationProgress[]|null); + } + + /** Represents an AnnotateVideoProgress. */ + class AnnotateVideoProgress implements IAnnotateVideoProgress { + + /** + * Constructs a new AnnotateVideoProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IAnnotateVideoProgress); + + /** AnnotateVideoProgress annotationProgress. */ + public annotationProgress: google.cloud.videointelligence.v1.IVideoAnnotationProgress[]; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IAnnotateVideoProgress): google.cloud.videointelligence.v1.AnnotateVideoProgress; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoProgress + * @throws {Error} If the payload is not 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.videointelligence.v1.AnnotateVideoProgress; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoProgress + * @throws {Error} If the payload 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.videointelligence.v1.AnnotateVideoProgress; + + /** + * Verifies an AnnotateVideoProgress message. + * @param message Plain 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 AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.AnnotateVideoProgress; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @param message AnnotateVideoProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.AnnotateVideoProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechTranscriptionConfig. */ + interface ISpeechTranscriptionConfig { + + /** SpeechTranscriptionConfig languageCode */ + languageCode?: (string|null); + + /** SpeechTranscriptionConfig maxAlternatives */ + maxAlternatives?: (number|null); + + /** SpeechTranscriptionConfig filterProfanity */ + filterProfanity?: (boolean|null); + + /** SpeechTranscriptionConfig speechContexts */ + speechContexts?: (google.cloud.videointelligence.v1.ISpeechContext[]|null); + + /** SpeechTranscriptionConfig enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** SpeechTranscriptionConfig audioTracks */ + audioTracks?: (number[]|null); + + /** SpeechTranscriptionConfig enableSpeakerDiarization */ + enableSpeakerDiarization?: (boolean|null); + + /** SpeechTranscriptionConfig diarizationSpeakerCount */ + diarizationSpeakerCount?: (number|null); + + /** SpeechTranscriptionConfig enableWordConfidence */ + enableWordConfidence?: (boolean|null); + } + + /** Represents a SpeechTranscriptionConfig. */ + class SpeechTranscriptionConfig implements ISpeechTranscriptionConfig { + + /** + * Constructs a new SpeechTranscriptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ISpeechTranscriptionConfig); + + /** SpeechTranscriptionConfig languageCode. */ + public languageCode: string; + + /** SpeechTranscriptionConfig maxAlternatives. */ + public maxAlternatives: number; + + /** SpeechTranscriptionConfig filterProfanity. */ + public filterProfanity: boolean; + + /** SpeechTranscriptionConfig speechContexts. */ + public speechContexts: google.cloud.videointelligence.v1.ISpeechContext[]; + + /** SpeechTranscriptionConfig enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** SpeechTranscriptionConfig audioTracks. */ + public audioTracks: number[]; + + /** SpeechTranscriptionConfig enableSpeakerDiarization. */ + public enableSpeakerDiarization: boolean; + + /** SpeechTranscriptionConfig diarizationSpeakerCount. */ + public diarizationSpeakerCount: number; + + /** SpeechTranscriptionConfig enableWordConfidence. */ + public enableWordConfidence: boolean; + + /** + * Creates a new SpeechTranscriptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechTranscriptionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ISpeechTranscriptionConfig): google.cloud.videointelligence.v1.SpeechTranscriptionConfig; + + /** + * Encodes the specified SpeechTranscriptionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscriptionConfig.verify|verify} messages. + * @param message SpeechTranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ISpeechTranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechTranscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscriptionConfig.verify|verify} messages. + * @param message SpeechTranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ISpeechTranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechTranscriptionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1.SpeechTranscriptionConfig; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechTranscriptionConfig + * @throws {Error} If the payload 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.videointelligence.v1.SpeechTranscriptionConfig; + + /** + * Verifies a SpeechTranscriptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechTranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechTranscriptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.SpeechTranscriptionConfig; + + /** + * Creates a plain object from a SpeechTranscriptionConfig message. Also converts values to other types if specified. + * @param message SpeechTranscriptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.SpeechTranscriptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechTranscriptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechTranscriptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ISpeechContext): google.cloud.videointelligence.v1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not 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.videointelligence.v1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload 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.videointelligence.v1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechTranscription. */ + interface ISpeechTranscription { + + /** SpeechTranscription alternatives */ + alternatives?: (google.cloud.videointelligence.v1.ISpeechRecognitionAlternative[]|null); + + /** SpeechTranscription languageCode */ + languageCode?: (string|null); + } + + /** Represents a SpeechTranscription. */ + class SpeechTranscription implements ISpeechTranscription { + + /** + * Constructs a new SpeechTranscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ISpeechTranscription); + + /** SpeechTranscription alternatives. */ + public alternatives: google.cloud.videointelligence.v1.ISpeechRecognitionAlternative[]; + + /** SpeechTranscription languageCode. */ + public languageCode: string; + + /** + * Creates a new SpeechTranscription instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechTranscription instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ISpeechTranscription): google.cloud.videointelligence.v1.SpeechTranscription; + + /** + * Encodes the specified SpeechTranscription message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscription.verify|verify} messages. + * @param message SpeechTranscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ISpeechTranscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechTranscription message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscription.verify|verify} messages. + * @param message SpeechTranscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ISpeechTranscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechTranscription + * @throws {Error} If the payload is not 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.videointelligence.v1.SpeechTranscription; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechTranscription + * @throws {Error} If the payload 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.videointelligence.v1.SpeechTranscription; + + /** + * Verifies a SpeechTranscription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechTranscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechTranscription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.SpeechTranscription; + + /** + * Creates a plain object from a SpeechTranscription message. Also converts values to other types if specified. + * @param message SpeechTranscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.SpeechTranscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechTranscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechTranscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.videointelligence.v1.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.videointelligence.v1.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ISpeechRecognitionAlternative): google.cloud.videointelligence.v1.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not 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.videointelligence.v1.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload 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.videointelligence.v1.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startTime */ + startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime */ + endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + + /** WordInfo confidence */ + confidence?: (number|null); + + /** WordInfo speakerTag */ + speakerTag?: (number|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IWordInfo); + + /** WordInfo startTime. */ + public startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime. */ + public endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** WordInfo confidence. */ + public confidence: number; + + /** WordInfo speakerTag. */ + public speakerTag: number; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IWordInfo): google.cloud.videointelligence.v1.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.videointelligence.v1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not 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.videointelligence.v1.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload 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.videointelligence.v1.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.videointelligence.v1.INormalizedVertex): google.cloud.videointelligence.v1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not 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.videointelligence.v1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload 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.videointelligence.v1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingPoly. */ + interface INormalizedBoundingPoly { + + /** NormalizedBoundingPoly vertices */ + vertices?: (google.cloud.videointelligence.v1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedBoundingPoly. */ + class NormalizedBoundingPoly implements INormalizedBoundingPoly { + + /** + * Constructs a new NormalizedBoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.INormalizedBoundingPoly); + + /** NormalizedBoundingPoly vertices. */ + public vertices: google.cloud.videointelligence.v1.INormalizedVertex[]; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingPoly instance + */ + public static create(properties?: google.cloud.videointelligence.v1.INormalizedBoundingPoly): google.cloud.videointelligence.v1.NormalizedBoundingPoly; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload is not 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.videointelligence.v1.NormalizedBoundingPoly; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload 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.videointelligence.v1.NormalizedBoundingPoly; + + /** + * Verifies a NormalizedBoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.NormalizedBoundingPoly; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @param message NormalizedBoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.NormalizedBoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingPoly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** TextSegment confidence */ + confidence?: (number|null); + + /** TextSegment frames */ + frames?: (google.cloud.videointelligence.v1.ITextFrame[]|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ITextSegment); + + /** TextSegment segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** TextSegment confidence. */ + public confidence: number; + + /** TextSegment frames. */ + public frames: google.cloud.videointelligence.v1.ITextFrame[]; + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ITextSegment): google.cloud.videointelligence.v1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not 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.videointelligence.v1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload 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.videointelligence.v1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextFrame. */ + interface ITextFrame { + + /** TextFrame rotatedBoundingBox */ + rotatedBoundingBox?: (google.cloud.videointelligence.v1.INormalizedBoundingPoly|null); + + /** TextFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a TextFrame. */ + class TextFrame implements ITextFrame { + + /** + * Constructs a new TextFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ITextFrame); + + /** TextFrame rotatedBoundingBox. */ + public rotatedBoundingBox?: (google.cloud.videointelligence.v1.INormalizedBoundingPoly|null); + + /** TextFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new TextFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns TextFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ITextFrame): google.cloud.videointelligence.v1.TextFrame; + + /** + * Encodes the specified TextFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.TextFrame.verify|verify} messages. + * @param message TextFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ITextFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextFrame.verify|verify} messages. + * @param message TextFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ITextFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextFrame + * @throws {Error} If the payload is not 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.videointelligence.v1.TextFrame; + + /** + * Decodes a TextFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextFrame + * @throws {Error} If the payload 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.videointelligence.v1.TextFrame; + + /** + * Verifies a TextFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.TextFrame; + + /** + * Creates a plain object from a TextFrame message. Also converts values to other types if specified. + * @param message TextFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.TextFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation text */ + text?: (string|null); + + /** TextAnnotation segments */ + segments?: (google.cloud.videointelligence.v1.ITextSegment[]|null); + + /** TextAnnotation version */ + version?: (string|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ITextAnnotation); + + /** TextAnnotation text. */ + public text: string; + + /** TextAnnotation segments. */ + public segments: google.cloud.videointelligence.v1.ITextSegment[]; + + /** TextAnnotation version. */ + public version: string; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ITextAnnotation): google.cloud.videointelligence.v1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingFrame. */ + interface IObjectTrackingFrame { + + /** ObjectTrackingFrame normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.videointelligence.v1.INormalizedBoundingBox|null); + + /** ObjectTrackingFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an ObjectTrackingFrame. */ + class ObjectTrackingFrame implements IObjectTrackingFrame { + + /** + * Constructs a new ObjectTrackingFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IObjectTrackingFrame); + + /** ObjectTrackingFrame normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.videointelligence.v1.INormalizedBoundingBox|null); + + /** ObjectTrackingFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IObjectTrackingFrame): google.cloud.videointelligence.v1.ObjectTrackingFrame; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingFrame.verify|verify} messages. + * @param message ObjectTrackingFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingFrame.verify|verify} messages. + * @param message ObjectTrackingFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingFrame + * @throws {Error} If the payload is not 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.videointelligence.v1.ObjectTrackingFrame; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingFrame + * @throws {Error} If the payload 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.videointelligence.v1.ObjectTrackingFrame; + + /** + * Verifies an ObjectTrackingFrame message. + * @param message Plain 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 ObjectTrackingFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ObjectTrackingFrame; + + /** + * Creates a plain object from an ObjectTrackingFrame message. Also converts values to other types if specified. + * @param message ObjectTrackingFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ObjectTrackingFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingAnnotation. */ + interface IObjectTrackingAnnotation { + + /** ObjectTrackingAnnotation segment */ + segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId */ + trackId?: (number|Long|string|null); + + /** ObjectTrackingAnnotation entity */ + entity?: (google.cloud.videointelligence.v1.IEntity|null); + + /** ObjectTrackingAnnotation confidence */ + confidence?: (number|null); + + /** ObjectTrackingAnnotation frames */ + frames?: (google.cloud.videointelligence.v1.IObjectTrackingFrame[]|null); + + /** ObjectTrackingAnnotation version */ + version?: (string|null); + } + + /** Represents an ObjectTrackingAnnotation. */ + class ObjectTrackingAnnotation implements IObjectTrackingAnnotation { + + /** + * Constructs a new ObjectTrackingAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.IObjectTrackingAnnotation); + + /** ObjectTrackingAnnotation segment. */ + public segment?: (google.cloud.videointelligence.v1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId. */ + public trackId?: (number|Long|string|null); + + /** ObjectTrackingAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1.IEntity|null); + + /** ObjectTrackingAnnotation confidence. */ + public confidence: number; + + /** ObjectTrackingAnnotation frames. */ + public frames: google.cloud.videointelligence.v1.IObjectTrackingFrame[]; + + /** ObjectTrackingAnnotation version. */ + public version: string; + + /** ObjectTrackingAnnotation trackInfo. */ + public trackInfo?: ("segment"|"trackId"); + + /** + * Creates a new ObjectTrackingAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.IObjectTrackingAnnotation): google.cloud.videointelligence.v1.ObjectTrackingAnnotation; + + /** + * Encodes the specified ObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingAnnotation.verify|verify} messages. + * @param message ObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.IObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingAnnotation.verify|verify} messages. + * @param message ObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.IObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.ObjectTrackingAnnotation; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.ObjectTrackingAnnotation; + + /** + * Verifies an ObjectTrackingAnnotation message. + * @param message Plain 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 ObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.ObjectTrackingAnnotation; + + /** + * Creates a plain object from an ObjectTrackingAnnotation message. Also converts values to other types if specified. + * @param message ObjectTrackingAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.ObjectTrackingAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogoRecognitionAnnotation. */ + interface ILogoRecognitionAnnotation { + + /** LogoRecognitionAnnotation entity */ + entity?: (google.cloud.videointelligence.v1.IEntity|null); + + /** LogoRecognitionAnnotation tracks */ + tracks?: (google.cloud.videointelligence.v1.ITrack[]|null); + + /** LogoRecognitionAnnotation segments */ + segments?: (google.cloud.videointelligence.v1.IVideoSegment[]|null); + } + + /** Represents a LogoRecognitionAnnotation. */ + class LogoRecognitionAnnotation implements ILogoRecognitionAnnotation { + + /** + * Constructs a new LogoRecognitionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1.ILogoRecognitionAnnotation); + + /** LogoRecognitionAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1.IEntity|null); + + /** LogoRecognitionAnnotation tracks. */ + public tracks: google.cloud.videointelligence.v1.ITrack[]; + + /** LogoRecognitionAnnotation segments. */ + public segments: google.cloud.videointelligence.v1.IVideoSegment[]; + + /** + * Creates a new LogoRecognitionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LogoRecognitionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1.ILogoRecognitionAnnotation): google.cloud.videointelligence.v1.LogoRecognitionAnnotation; + + /** + * Encodes the specified LogoRecognitionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.LogoRecognitionAnnotation.verify|verify} messages. + * @param message LogoRecognitionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1.ILogoRecognitionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogoRecognitionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LogoRecognitionAnnotation.verify|verify} messages. + * @param message LogoRecognitionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1.ILogoRecognitionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogoRecognitionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1.LogoRecognitionAnnotation; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogoRecognitionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1.LogoRecognitionAnnotation; + + /** + * Verifies a LogoRecognitionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogoRecognitionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogoRecognitionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1.LogoRecognitionAnnotation; + + /** + * Creates a plain object from a LogoRecognitionAnnotation message. Also converts values to other types if specified. + * @param message LogoRecognitionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1.LogoRecognitionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogoRecognitionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogoRecognitionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta2. */ + namespace v1beta2 { + + /** Represents a VideoIntelligenceService */ + class VideoIntelligenceService extends $protobuf.rpc.Service { + + /** + * Constructs a new VideoIntelligenceService 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 VideoIntelligenceService 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): VideoIntelligenceService; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public annotateVideo(request: google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, callback: google.cloud.videointelligence.v1beta2.VideoIntelligenceService.AnnotateVideoCallback): void; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @returns Promise + */ + public annotateVideo(request: google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest): Promise; + } + + namespace VideoIntelligenceService { + + /** + * Callback as used by {@link google.cloud.videointelligence.v1beta2.VideoIntelligenceService|annotateVideo}. + * @param error Error, if any + * @param [response] Operation + */ + type AnnotateVideoCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an AnnotateVideoRequest. */ + interface IAnnotateVideoRequest { + + /** AnnotateVideoRequest inputUri */ + inputUri?: (string|null); + + /** AnnotateVideoRequest inputContent */ + inputContent?: (Uint8Array|string|null); + + /** AnnotateVideoRequest features */ + features?: (google.cloud.videointelligence.v1beta2.Feature[]|null); + + /** AnnotateVideoRequest videoContext */ + videoContext?: (google.cloud.videointelligence.v1beta2.IVideoContext|null); + + /** AnnotateVideoRequest outputUri */ + outputUri?: (string|null); + + /** AnnotateVideoRequest locationId */ + locationId?: (string|null); + } + + /** Represents an AnnotateVideoRequest. */ + class AnnotateVideoRequest implements IAnnotateVideoRequest { + + /** + * Constructs a new AnnotateVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest); + + /** AnnotateVideoRequest inputUri. */ + public inputUri: string; + + /** AnnotateVideoRequest inputContent. */ + public inputContent: (Uint8Array|string); + + /** AnnotateVideoRequest features. */ + public features: google.cloud.videointelligence.v1beta2.Feature[]; + + /** AnnotateVideoRequest videoContext. */ + public videoContext?: (google.cloud.videointelligence.v1beta2.IVideoContext|null); + + /** AnnotateVideoRequest outputUri. */ + public outputUri: string; + + /** AnnotateVideoRequest locationId. */ + public locationId: string; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoRequest instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest): google.cloud.videointelligence.v1beta2.AnnotateVideoRequest; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoRequest + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.AnnotateVideoRequest; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoRequest + * @throws {Error} If the payload 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.videointelligence.v1beta2.AnnotateVideoRequest; + + /** + * Verifies an AnnotateVideoRequest message. + * @param message Plain 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 AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.AnnotateVideoRequest; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @param message AnnotateVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.AnnotateVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoContext. */ + interface IVideoContext { + + /** VideoContext segments */ + segments?: (google.cloud.videointelligence.v1beta2.IVideoSegment[]|null); + + /** VideoContext labelDetectionConfig */ + labelDetectionConfig?: (google.cloud.videointelligence.v1beta2.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig */ + shotChangeDetectionConfig?: (google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig */ + explicitContentDetectionConfig?: (google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig|null); + + /** VideoContext faceDetectionConfig */ + faceDetectionConfig?: (google.cloud.videointelligence.v1beta2.IFaceDetectionConfig|null); + } + + /** Represents a VideoContext. */ + class VideoContext implements IVideoContext { + + /** + * Constructs a new VideoContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IVideoContext); + + /** VideoContext segments. */ + public segments: google.cloud.videointelligence.v1beta2.IVideoSegment[]; + + /** VideoContext labelDetectionConfig. */ + public labelDetectionConfig?: (google.cloud.videointelligence.v1beta2.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig. */ + public shotChangeDetectionConfig?: (google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig. */ + public explicitContentDetectionConfig?: (google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig|null); + + /** VideoContext faceDetectionConfig. */ + public faceDetectionConfig?: (google.cloud.videointelligence.v1beta2.IFaceDetectionConfig|null); + + /** + * Creates a new VideoContext instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IVideoContext): google.cloud.videointelligence.v1beta2.VideoContext; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoContext + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.VideoContext; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoContext + * @throws {Error} If the payload 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.videointelligence.v1beta2.VideoContext; + + /** + * Verifies a VideoContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.VideoContext; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @param message VideoContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.VideoContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelDetectionConfig. */ + interface ILabelDetectionConfig { + + /** LabelDetectionConfig labelDetectionMode */ + labelDetectionMode?: (google.cloud.videointelligence.v1beta2.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1beta2.LabelDetectionMode|null); + + /** LabelDetectionConfig stationaryCamera */ + stationaryCamera?: (boolean|null); + + /** LabelDetectionConfig model */ + model?: (string|null); + } + + /** Represents a LabelDetectionConfig. */ + class LabelDetectionConfig implements ILabelDetectionConfig { + + /** + * Constructs a new LabelDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.ILabelDetectionConfig); + + /** LabelDetectionConfig labelDetectionMode. */ + public labelDetectionMode: (google.cloud.videointelligence.v1beta2.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1beta2.LabelDetectionMode); + + /** LabelDetectionConfig stationaryCamera. */ + public stationaryCamera: boolean; + + /** LabelDetectionConfig model. */ + public model: string; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.ILabelDetectionConfig): google.cloud.videointelligence.v1beta2.LabelDetectionConfig; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.LabelDetectionConfig; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1beta2.LabelDetectionConfig; + + /** + * Verifies a LabelDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.LabelDetectionConfig; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @param message LabelDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.LabelDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShotChangeDetectionConfig. */ + interface IShotChangeDetectionConfig { + + /** ShotChangeDetectionConfig model */ + model?: (string|null); + } + + /** Represents a ShotChangeDetectionConfig. */ + class ShotChangeDetectionConfig implements IShotChangeDetectionConfig { + + /** + * Constructs a new ShotChangeDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig); + + /** ShotChangeDetectionConfig model. */ + public model: string; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShotChangeDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig): google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.ShotChangeDetectionConfig; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1beta2.ShotChangeDetectionConfig; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShotChangeDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @param message ShotChangeDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentDetectionConfig. */ + interface IExplicitContentDetectionConfig { + + /** ExplicitContentDetectionConfig model */ + model?: (string|null); + } + + /** Represents an ExplicitContentDetectionConfig. */ + class ExplicitContentDetectionConfig implements IExplicitContentDetectionConfig { + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig); + + /** ExplicitContentDetectionConfig model. */ + public model: string; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig): google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.ExplicitContentDetectionConfig; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1beta2.ExplicitContentDetectionConfig; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @param message Plain 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 ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @param message ExplicitContentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceDetectionConfig. */ + interface IFaceDetectionConfig { + + /** FaceDetectionConfig model */ + model?: (string|null); + + /** FaceDetectionConfig includeBoundingBoxes */ + includeBoundingBoxes?: (boolean|null); + } + + /** Represents a FaceDetectionConfig. */ + class FaceDetectionConfig implements IFaceDetectionConfig { + + /** + * Constructs a new FaceDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IFaceDetectionConfig); + + /** FaceDetectionConfig model. */ + public model: string; + + /** FaceDetectionConfig includeBoundingBoxes. */ + public includeBoundingBoxes: boolean; + + /** + * Creates a new FaceDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IFaceDetectionConfig): google.cloud.videointelligence.v1beta2.FaceDetectionConfig; + + /** + * Encodes the specified FaceDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceDetectionConfig.verify|verify} messages. + * @param message FaceDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IFaceDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceDetectionConfig.verify|verify} messages. + * @param message FaceDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IFaceDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.FaceDetectionConfig; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1beta2.FaceDetectionConfig; + + /** + * Verifies a FaceDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.FaceDetectionConfig; + + /** + * Creates a plain object from a FaceDetectionConfig message. Also converts values to other types if specified. + * @param message FaceDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.FaceDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoSegment. */ + interface IVideoSegment { + + /** VideoSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoSegment. */ + class VideoSegment implements IVideoSegment { + + /** + * Constructs a new VideoSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IVideoSegment); + + /** VideoSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IVideoSegment): google.cloud.videointelligence.v1beta2.VideoSegment; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoSegment + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.VideoSegment; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoSegment + * @throws {Error} If the payload 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.videointelligence.v1beta2.VideoSegment; + + /** + * Verifies a VideoSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.VideoSegment; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @param message VideoSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.VideoSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelSegment. */ + interface ILabelSegment { + + /** LabelSegment segment */ + segment?: (google.cloud.videointelligence.v1beta2.IVideoSegment|null); + + /** LabelSegment confidence */ + confidence?: (number|null); + } + + /** Represents a LabelSegment. */ + class LabelSegment implements ILabelSegment { + + /** + * Constructs a new LabelSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.ILabelSegment); + + /** LabelSegment segment. */ + public segment?: (google.cloud.videointelligence.v1beta2.IVideoSegment|null); + + /** LabelSegment confidence. */ + public confidence: number; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.ILabelSegment): google.cloud.videointelligence.v1beta2.LabelSegment; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSegment + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.LabelSegment; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSegment + * @throws {Error} If the payload 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.videointelligence.v1beta2.LabelSegment; + + /** + * Verifies a LabelSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.LabelSegment; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @param message LabelSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.LabelSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelFrame. */ + interface ILabelFrame { + + /** LabelFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence */ + confidence?: (number|null); + } + + /** Represents a LabelFrame. */ + class LabelFrame implements ILabelFrame { + + /** + * Constructs a new LabelFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.ILabelFrame); + + /** LabelFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence. */ + public confidence: number; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.ILabelFrame): google.cloud.videointelligence.v1beta2.LabelFrame; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelFrame + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.LabelFrame; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelFrame + * @throws {Error} If the payload 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.videointelligence.v1beta2.LabelFrame; + + /** + * Verifies a LabelFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.LabelFrame; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @param message LabelFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.LabelFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity entityId */ + entityId?: (string|null); + + /** Entity description */ + description?: (string|null); + + /** Entity languageCode */ + languageCode?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IEntity); + + /** Entity entityId. */ + public entityId: string; + + /** Entity description. */ + public description: string; + + /** Entity languageCode. */ + public languageCode: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IEntity): google.cloud.videointelligence.v1beta2.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload 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.videointelligence.v1beta2.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelAnnotation. */ + interface ILabelAnnotation { + + /** LabelAnnotation entity */ + entity?: (google.cloud.videointelligence.v1beta2.IEntity|null); + + /** LabelAnnotation categoryEntities */ + categoryEntities?: (google.cloud.videointelligence.v1beta2.IEntity[]|null); + + /** LabelAnnotation segments */ + segments?: (google.cloud.videointelligence.v1beta2.ILabelSegment[]|null); + + /** LabelAnnotation frames */ + frames?: (google.cloud.videointelligence.v1beta2.ILabelFrame[]|null); + } + + /** Represents a LabelAnnotation. */ + class LabelAnnotation implements ILabelAnnotation { + + /** + * Constructs a new LabelAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.ILabelAnnotation); + + /** LabelAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1beta2.IEntity|null); + + /** LabelAnnotation categoryEntities. */ + public categoryEntities: google.cloud.videointelligence.v1beta2.IEntity[]; + + /** LabelAnnotation segments. */ + public segments: google.cloud.videointelligence.v1beta2.ILabelSegment[]; + + /** LabelAnnotation frames. */ + public frames: google.cloud.videointelligence.v1beta2.ILabelFrame[]; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.ILabelAnnotation): google.cloud.videointelligence.v1beta2.LabelAnnotation; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.LabelAnnotation; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelAnnotation + * @throws {Error} If the payload 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.videointelligence.v1beta2.LabelAnnotation; + + /** + * Verifies a LabelAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.LabelAnnotation; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @param message LabelAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.LabelAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentFrame. */ + interface IExplicitContentFrame { + + /** ExplicitContentFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood */ + pornographyLikelihood?: (google.cloud.videointelligence.v1beta2.Likelihood|keyof typeof google.cloud.videointelligence.v1beta2.Likelihood|null); + } + + /** Represents an ExplicitContentFrame. */ + class ExplicitContentFrame implements IExplicitContentFrame { + + /** + * Constructs a new ExplicitContentFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IExplicitContentFrame); + + /** ExplicitContentFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood. */ + public pornographyLikelihood: (google.cloud.videointelligence.v1beta2.Likelihood|keyof typeof google.cloud.videointelligence.v1beta2.Likelihood); + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IExplicitContentFrame): google.cloud.videointelligence.v1beta2.ExplicitContentFrame; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentFrame + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.ExplicitContentFrame; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentFrame + * @throws {Error} If the payload 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.videointelligence.v1beta2.ExplicitContentFrame; + + /** + * Verifies an ExplicitContentFrame message. + * @param message Plain 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 ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.ExplicitContentFrame; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @param message ExplicitContentFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.ExplicitContentFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentAnnotation. */ + interface IExplicitContentAnnotation { + + /** ExplicitContentAnnotation frames */ + frames?: (google.cloud.videointelligence.v1beta2.IExplicitContentFrame[]|null); + } + + /** Represents an ExplicitContentAnnotation. */ + class ExplicitContentAnnotation implements IExplicitContentAnnotation { + + /** + * Constructs a new ExplicitContentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation); + + /** ExplicitContentAnnotation frames. */ + public frames: google.cloud.videointelligence.v1beta2.IExplicitContentFrame[]; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation): google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.ExplicitContentAnnotation; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload 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.videointelligence.v1beta2.ExplicitContentAnnotation; + + /** + * Verifies an ExplicitContentAnnotation message. + * @param message Plain 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 ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @param message ExplicitContentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox left */ + left?: (number|null); + + /** NormalizedBoundingBox top */ + top?: (number|null); + + /** NormalizedBoundingBox right */ + right?: (number|null); + + /** NormalizedBoundingBox bottom */ + bottom?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.INormalizedBoundingBox); + + /** NormalizedBoundingBox left. */ + public left: number; + + /** NormalizedBoundingBox top. */ + public top: number; + + /** NormalizedBoundingBox right. */ + public right: number; + + /** NormalizedBoundingBox bottom. */ + public bottom: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.INormalizedBoundingBox): google.cloud.videointelligence.v1beta2.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload 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.videointelligence.v1beta2.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceSegment. */ + interface IFaceSegment { + + /** FaceSegment segment */ + segment?: (google.cloud.videointelligence.v1beta2.IVideoSegment|null); + } + + /** Represents a FaceSegment. */ + class FaceSegment implements IFaceSegment { + + /** + * Constructs a new FaceSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IFaceSegment); + + /** FaceSegment segment. */ + public segment?: (google.cloud.videointelligence.v1beta2.IVideoSegment|null); + + /** + * Creates a new FaceSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IFaceSegment): google.cloud.videointelligence.v1beta2.FaceSegment; + + /** + * Encodes the specified FaceSegment message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceSegment.verify|verify} messages. + * @param message FaceSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IFaceSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceSegment.verify|verify} messages. + * @param message FaceSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IFaceSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceSegment + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.FaceSegment; + + /** + * Decodes a FaceSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceSegment + * @throws {Error} If the payload 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.videointelligence.v1beta2.FaceSegment; + + /** + * Verifies a FaceSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.FaceSegment; + + /** + * Creates a plain object from a FaceSegment message. Also converts values to other types if specified. + * @param message FaceSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.FaceSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceFrame. */ + interface IFaceFrame { + + /** FaceFrame normalizedBoundingBoxes */ + normalizedBoundingBoxes?: (google.cloud.videointelligence.v1beta2.INormalizedBoundingBox[]|null); + + /** FaceFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a FaceFrame. */ + class FaceFrame implements IFaceFrame { + + /** + * Constructs a new FaceFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IFaceFrame); + + /** FaceFrame normalizedBoundingBoxes. */ + public normalizedBoundingBoxes: google.cloud.videointelligence.v1beta2.INormalizedBoundingBox[]; + + /** FaceFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new FaceFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IFaceFrame): google.cloud.videointelligence.v1beta2.FaceFrame; + + /** + * Encodes the specified FaceFrame message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceFrame.verify|verify} messages. + * @param message FaceFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IFaceFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceFrame.verify|verify} messages. + * @param message FaceFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IFaceFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceFrame + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.FaceFrame; + + /** + * Decodes a FaceFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceFrame + * @throws {Error} If the payload 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.videointelligence.v1beta2.FaceFrame; + + /** + * Verifies a FaceFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.FaceFrame; + + /** + * Creates a plain object from a FaceFrame message. Also converts values to other types if specified. + * @param message FaceFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.FaceFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceAnnotation. */ + interface IFaceAnnotation { + + /** FaceAnnotation thumbnail */ + thumbnail?: (Uint8Array|string|null); + + /** FaceAnnotation segments */ + segments?: (google.cloud.videointelligence.v1beta2.IFaceSegment[]|null); + + /** FaceAnnotation frames */ + frames?: (google.cloud.videointelligence.v1beta2.IFaceFrame[]|null); + } + + /** Represents a FaceAnnotation. */ + class FaceAnnotation implements IFaceAnnotation { + + /** + * Constructs a new FaceAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IFaceAnnotation); + + /** FaceAnnotation thumbnail. */ + public thumbnail: (Uint8Array|string); + + /** FaceAnnotation segments. */ + public segments: google.cloud.videointelligence.v1beta2.IFaceSegment[]; + + /** FaceAnnotation frames. */ + public frames: google.cloud.videointelligence.v1beta2.IFaceFrame[]; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IFaceAnnotation): google.cloud.videointelligence.v1beta2.FaceAnnotation; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceAnnotation.verify|verify} messages. + * @param message FaceAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IFaceAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.FaceAnnotation; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceAnnotation + * @throws {Error} If the payload 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.videointelligence.v1beta2.FaceAnnotation; + + /** + * Verifies a FaceAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.FaceAnnotation; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @param message FaceAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.FaceAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationResults. */ + interface IVideoAnnotationResults { + + /** VideoAnnotationResults inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationResults segmentLabelAnnotations */ + segmentLabelAnnotations?: (google.cloud.videointelligence.v1beta2.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotLabelAnnotations */ + shotLabelAnnotations?: (google.cloud.videointelligence.v1beta2.ILabelAnnotation[]|null); + + /** VideoAnnotationResults frameLabelAnnotations */ + frameLabelAnnotations?: (google.cloud.videointelligence.v1beta2.ILabelAnnotation[]|null); + + /** VideoAnnotationResults faceAnnotations */ + faceAnnotations?: (google.cloud.videointelligence.v1beta2.IFaceAnnotation[]|null); + + /** VideoAnnotationResults shotAnnotations */ + shotAnnotations?: (google.cloud.videointelligence.v1beta2.IVideoSegment[]|null); + + /** VideoAnnotationResults explicitAnnotation */ + explicitAnnotation?: (google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a VideoAnnotationResults. */ + class VideoAnnotationResults implements IVideoAnnotationResults { + + /** + * Constructs a new VideoAnnotationResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IVideoAnnotationResults); + + /** VideoAnnotationResults inputUri. */ + public inputUri: string; + + /** VideoAnnotationResults segmentLabelAnnotations. */ + public segmentLabelAnnotations: google.cloud.videointelligence.v1beta2.ILabelAnnotation[]; + + /** VideoAnnotationResults shotLabelAnnotations. */ + public shotLabelAnnotations: google.cloud.videointelligence.v1beta2.ILabelAnnotation[]; + + /** VideoAnnotationResults frameLabelAnnotations. */ + public frameLabelAnnotations: google.cloud.videointelligence.v1beta2.ILabelAnnotation[]; + + /** VideoAnnotationResults faceAnnotations. */ + public faceAnnotations: google.cloud.videointelligence.v1beta2.IFaceAnnotation[]; + + /** VideoAnnotationResults shotAnnotations. */ + public shotAnnotations: google.cloud.videointelligence.v1beta2.IVideoSegment[]; + + /** VideoAnnotationResults explicitAnnotation. */ + public explicitAnnotation?: (google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationResults instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IVideoAnnotationResults): google.cloud.videointelligence.v1beta2.VideoAnnotationResults; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationResults + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.VideoAnnotationResults; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationResults + * @throws {Error} If the payload 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.videointelligence.v1beta2.VideoAnnotationResults; + + /** + * Verifies a VideoAnnotationResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.VideoAnnotationResults; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @param message VideoAnnotationResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.VideoAnnotationResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoResponse. */ + interface IAnnotateVideoResponse { + + /** AnnotateVideoResponse annotationResults */ + annotationResults?: (google.cloud.videointelligence.v1beta2.IVideoAnnotationResults[]|null); + } + + /** Represents an AnnotateVideoResponse. */ + class AnnotateVideoResponse implements IAnnotateVideoResponse { + + /** + * Constructs a new AnnotateVideoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse); + + /** AnnotateVideoResponse annotationResults. */ + public annotationResults: google.cloud.videointelligence.v1beta2.IVideoAnnotationResults[]; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoResponse instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse): google.cloud.videointelligence.v1beta2.AnnotateVideoResponse; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoResponse + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.AnnotateVideoResponse; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoResponse + * @throws {Error} If the payload 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.videointelligence.v1beta2.AnnotateVideoResponse; + + /** + * Verifies an AnnotateVideoResponse message. + * @param message Plain 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 AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.AnnotateVideoResponse; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @param message AnnotateVideoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.AnnotateVideoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationProgress. */ + interface IVideoAnnotationProgress { + + /** VideoAnnotationProgress inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationProgress progressPercent */ + progressPercent?: (number|null); + + /** VideoAnnotationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VideoAnnotationProgress. */ + class VideoAnnotationProgress implements IVideoAnnotationProgress { + + /** + * Constructs a new VideoAnnotationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress); + + /** VideoAnnotationProgress inputUri. */ + public inputUri: string; + + /** VideoAnnotationProgress progressPercent. */ + public progressPercent: number; + + /** VideoAnnotationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress): google.cloud.videointelligence.v1beta2.VideoAnnotationProgress; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationProgress + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.VideoAnnotationProgress; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationProgress + * @throws {Error} If the payload 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.videointelligence.v1beta2.VideoAnnotationProgress; + + /** + * Verifies a VideoAnnotationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.VideoAnnotationProgress; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @param message VideoAnnotationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.VideoAnnotationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoProgress. */ + interface IAnnotateVideoProgress { + + /** AnnotateVideoProgress annotationProgress */ + annotationProgress?: (google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress[]|null); + } + + /** Represents an AnnotateVideoProgress. */ + class AnnotateVideoProgress implements IAnnotateVideoProgress { + + /** + * Constructs a new AnnotateVideoProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress); + + /** AnnotateVideoProgress annotationProgress. */ + public annotationProgress: google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress[]; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress): google.cloud.videointelligence.v1beta2.AnnotateVideoProgress; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoProgress + * @throws {Error} If the payload is not 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.videointelligence.v1beta2.AnnotateVideoProgress; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoProgress + * @throws {Error} If the payload 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.videointelligence.v1beta2.AnnotateVideoProgress; + + /** + * Verifies an AnnotateVideoProgress message. + * @param message Plain 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 AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1beta2.AnnotateVideoProgress; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @param message AnnotateVideoProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1beta2.AnnotateVideoProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + LABEL_DETECTION = 1, + SHOT_CHANGE_DETECTION = 2, + EXPLICIT_CONTENT_DETECTION = 3, + FACE_DETECTION = 4 + } + + /** LabelDetectionMode enum. */ + enum LabelDetectionMode { + LABEL_DETECTION_MODE_UNSPECIFIED = 0, + SHOT_MODE = 1, + FRAME_MODE = 2, + SHOT_AND_FRAME_MODE = 3 + } + + /** Likelihood enum. */ + enum Likelihood { + LIKELIHOOD_UNSPECIFIED = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + } + + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { + + /** Represents a VideoIntelligenceService */ + class VideoIntelligenceService extends $protobuf.rpc.Service { + + /** + * Constructs a new VideoIntelligenceService 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 VideoIntelligenceService 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): VideoIntelligenceService; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public annotateVideo(request: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, callback: google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService.AnnotateVideoCallback): void; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @returns Promise + */ + public annotateVideo(request: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest): Promise; + } + + namespace VideoIntelligenceService { + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService|annotateVideo}. + * @param error Error, if any + * @param [response] Operation + */ + type AnnotateVideoCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an AnnotateVideoRequest. */ + interface IAnnotateVideoRequest { + + /** AnnotateVideoRequest inputUri */ + inputUri?: (string|null); + + /** AnnotateVideoRequest inputContent */ + inputContent?: (Uint8Array|string|null); + + /** AnnotateVideoRequest features */ + features?: (google.cloud.videointelligence.v1p1beta1.Feature[]|null); + + /** AnnotateVideoRequest videoContext */ + videoContext?: (google.cloud.videointelligence.v1p1beta1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri */ + outputUri?: (string|null); + + /** AnnotateVideoRequest locationId */ + locationId?: (string|null); + } + + /** Represents an AnnotateVideoRequest. */ + class AnnotateVideoRequest implements IAnnotateVideoRequest { + + /** + * Constructs a new AnnotateVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest); + + /** AnnotateVideoRequest inputUri. */ + public inputUri: string; + + /** AnnotateVideoRequest inputContent. */ + public inputContent: (Uint8Array|string); + + /** AnnotateVideoRequest features. */ + public features: google.cloud.videointelligence.v1p1beta1.Feature[]; + + /** AnnotateVideoRequest videoContext. */ + public videoContext?: (google.cloud.videointelligence.v1p1beta1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri. */ + public outputUri: string; + + /** AnnotateVideoRequest locationId. */ + public locationId: string; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoRequest instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest): google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoRequest + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.AnnotateVideoRequest; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoRequest + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.AnnotateVideoRequest; + + /** + * Verifies an AnnotateVideoRequest message. + * @param message Plain 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 AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @param message AnnotateVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoContext. */ + interface IVideoContext { + + /** VideoContext segments */ + segments?: (google.cloud.videointelligence.v1p1beta1.IVideoSegment[]|null); + + /** VideoContext labelDetectionConfig */ + labelDetectionConfig?: (google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig */ + shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig */ + explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig|null); + + /** VideoContext speechTranscriptionConfig */ + speechTranscriptionConfig?: (google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig|null); + } + + /** Represents a VideoContext. */ + class VideoContext implements IVideoContext { + + /** + * Constructs a new VideoContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IVideoContext); + + /** VideoContext segments. */ + public segments: google.cloud.videointelligence.v1p1beta1.IVideoSegment[]; + + /** VideoContext labelDetectionConfig. */ + public labelDetectionConfig?: (google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig. */ + public shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig. */ + public explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig|null); + + /** VideoContext speechTranscriptionConfig. */ + public speechTranscriptionConfig?: (google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig|null); + + /** + * Creates a new VideoContext instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IVideoContext): google.cloud.videointelligence.v1p1beta1.VideoContext; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoContext + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.VideoContext; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoContext + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.VideoContext; + + /** + * Verifies a VideoContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.VideoContext; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @param message VideoContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.VideoContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelDetectionConfig. */ + interface ILabelDetectionConfig { + + /** LabelDetectionConfig labelDetectionMode */ + labelDetectionMode?: (google.cloud.videointelligence.v1p1beta1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1p1beta1.LabelDetectionMode|null); + + /** LabelDetectionConfig stationaryCamera */ + stationaryCamera?: (boolean|null); + + /** LabelDetectionConfig model */ + model?: (string|null); + } + + /** Represents a LabelDetectionConfig. */ + class LabelDetectionConfig implements ILabelDetectionConfig { + + /** + * Constructs a new LabelDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig); + + /** LabelDetectionConfig labelDetectionMode. */ + public labelDetectionMode: (google.cloud.videointelligence.v1p1beta1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1p1beta1.LabelDetectionMode); + + /** LabelDetectionConfig stationaryCamera. */ + public stationaryCamera: boolean; + + /** LabelDetectionConfig model. */ + public model: string; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig): google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.LabelDetectionConfig; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.LabelDetectionConfig; + + /** + * Verifies a LabelDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @param message LabelDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShotChangeDetectionConfig. */ + interface IShotChangeDetectionConfig { + + /** ShotChangeDetectionConfig model */ + model?: (string|null); + } + + /** Represents a ShotChangeDetectionConfig. */ + class ShotChangeDetectionConfig implements IShotChangeDetectionConfig { + + /** + * Constructs a new ShotChangeDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig); + + /** ShotChangeDetectionConfig model. */ + public model: string; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShotChangeDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig): google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.ShotChangeDetectionConfig; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.ShotChangeDetectionConfig; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShotChangeDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @param message ShotChangeDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentDetectionConfig. */ + interface IExplicitContentDetectionConfig { + + /** ExplicitContentDetectionConfig model */ + model?: (string|null); + } + + /** Represents an ExplicitContentDetectionConfig. */ + class ExplicitContentDetectionConfig implements IExplicitContentDetectionConfig { + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig); + + /** ExplicitContentDetectionConfig model. */ + public model: string; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig): google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.ExplicitContentDetectionConfig; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.ExplicitContentDetectionConfig; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @param message Plain 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 ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @param message ExplicitContentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoSegment. */ + interface IVideoSegment { + + /** VideoSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoSegment. */ + class VideoSegment implements IVideoSegment { + + /** + * Constructs a new VideoSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IVideoSegment); + + /** VideoSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IVideoSegment): google.cloud.videointelligence.v1p1beta1.VideoSegment; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.VideoSegment; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoSegment + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.VideoSegment; + + /** + * Verifies a VideoSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.VideoSegment; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @param message VideoSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.VideoSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelSegment. */ + interface ILabelSegment { + + /** LabelSegment segment */ + segment?: (google.cloud.videointelligence.v1p1beta1.IVideoSegment|null); + + /** LabelSegment confidence */ + confidence?: (number|null); + } + + /** Represents a LabelSegment. */ + class LabelSegment implements ILabelSegment { + + /** + * Constructs a new LabelSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ILabelSegment); + + /** LabelSegment segment. */ + public segment?: (google.cloud.videointelligence.v1p1beta1.IVideoSegment|null); + + /** LabelSegment confidence. */ + public confidence: number; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ILabelSegment): google.cloud.videointelligence.v1p1beta1.LabelSegment; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.LabelSegment; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSegment + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.LabelSegment; + + /** + * Verifies a LabelSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.LabelSegment; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @param message LabelSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.LabelSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelFrame. */ + interface ILabelFrame { + + /** LabelFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence */ + confidence?: (number|null); + } + + /** Represents a LabelFrame. */ + class LabelFrame implements ILabelFrame { + + /** + * Constructs a new LabelFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ILabelFrame); + + /** LabelFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence. */ + public confidence: number; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ILabelFrame): google.cloud.videointelligence.v1p1beta1.LabelFrame; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.LabelFrame; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelFrame + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.LabelFrame; + + /** + * Verifies a LabelFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.LabelFrame; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @param message LabelFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.LabelFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity entityId */ + entityId?: (string|null); + + /** Entity description */ + description?: (string|null); + + /** Entity languageCode */ + languageCode?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IEntity); + + /** Entity entityId. */ + public entityId: string; + + /** Entity description. */ + public description: string; + + /** Entity languageCode. */ + public languageCode: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IEntity): google.cloud.videointelligence.v1p1beta1.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelAnnotation. */ + interface ILabelAnnotation { + + /** LabelAnnotation entity */ + entity?: (google.cloud.videointelligence.v1p1beta1.IEntity|null); + + /** LabelAnnotation categoryEntities */ + categoryEntities?: (google.cloud.videointelligence.v1p1beta1.IEntity[]|null); + + /** LabelAnnotation segments */ + segments?: (google.cloud.videointelligence.v1p1beta1.ILabelSegment[]|null); + + /** LabelAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p1beta1.ILabelFrame[]|null); + } + + /** Represents a LabelAnnotation. */ + class LabelAnnotation implements ILabelAnnotation { + + /** + * Constructs a new LabelAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation); + + /** LabelAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1p1beta1.IEntity|null); + + /** LabelAnnotation categoryEntities. */ + public categoryEntities: google.cloud.videointelligence.v1p1beta1.IEntity[]; + + /** LabelAnnotation segments. */ + public segments: google.cloud.videointelligence.v1p1beta1.ILabelSegment[]; + + /** LabelAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p1beta1.ILabelFrame[]; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation): google.cloud.videointelligence.v1p1beta1.LabelAnnotation; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.LabelAnnotation; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.LabelAnnotation; + + /** + * Verifies a LabelAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.LabelAnnotation; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @param message LabelAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.LabelAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentFrame. */ + interface IExplicitContentFrame { + + /** ExplicitContentFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood */ + pornographyLikelihood?: (google.cloud.videointelligence.v1p1beta1.Likelihood|keyof typeof google.cloud.videointelligence.v1p1beta1.Likelihood|null); + } + + /** Represents an ExplicitContentFrame. */ + class ExplicitContentFrame implements IExplicitContentFrame { + + /** + * Constructs a new ExplicitContentFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame); + + /** ExplicitContentFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood. */ + public pornographyLikelihood: (google.cloud.videointelligence.v1p1beta1.Likelihood|keyof typeof google.cloud.videointelligence.v1p1beta1.Likelihood); + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame): google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.ExplicitContentFrame; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentFrame + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.ExplicitContentFrame; + + /** + * Verifies an ExplicitContentFrame message. + * @param message Plain 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 ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @param message ExplicitContentFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentAnnotation. */ + interface IExplicitContentAnnotation { + + /** ExplicitContentAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame[]|null); + } + + /** Represents an ExplicitContentAnnotation. */ + class ExplicitContentAnnotation implements IExplicitContentAnnotation { + + /** + * Constructs a new ExplicitContentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation); + + /** ExplicitContentAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame[]; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation): google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.ExplicitContentAnnotation; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.ExplicitContentAnnotation; + + /** + * Verifies an ExplicitContentAnnotation message. + * @param message Plain 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 ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @param message ExplicitContentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationResults. */ + interface IVideoAnnotationResults { + + /** VideoAnnotationResults inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationResults segmentLabelAnnotations */ + segmentLabelAnnotations?: (google.cloud.videointelligence.v1p1beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotLabelAnnotations */ + shotLabelAnnotations?: (google.cloud.videointelligence.v1p1beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults frameLabelAnnotations */ + frameLabelAnnotations?: (google.cloud.videointelligence.v1p1beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotAnnotations */ + shotAnnotations?: (google.cloud.videointelligence.v1p1beta1.IVideoSegment[]|null); + + /** VideoAnnotationResults explicitAnnotation */ + explicitAnnotation?: (google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults speechTranscriptions */ + speechTranscriptions?: (google.cloud.videointelligence.v1p1beta1.ISpeechTranscription[]|null); + + /** VideoAnnotationResults error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a VideoAnnotationResults. */ + class VideoAnnotationResults implements IVideoAnnotationResults { + + /** + * Constructs a new VideoAnnotationResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults); + + /** VideoAnnotationResults inputUri. */ + public inputUri: string; + + /** VideoAnnotationResults segmentLabelAnnotations. */ + public segmentLabelAnnotations: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotLabelAnnotations. */ + public shotLabelAnnotations: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults frameLabelAnnotations. */ + public frameLabelAnnotations: google.cloud.videointelligence.v1p1beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotAnnotations. */ + public shotAnnotations: google.cloud.videointelligence.v1p1beta1.IVideoSegment[]; + + /** VideoAnnotationResults explicitAnnotation. */ + public explicitAnnotation?: (google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults speechTranscriptions. */ + public speechTranscriptions: google.cloud.videointelligence.v1p1beta1.ISpeechTranscription[]; + + /** VideoAnnotationResults error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationResults instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults): google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationResults + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.VideoAnnotationResults; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationResults + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.VideoAnnotationResults; + + /** + * Verifies a VideoAnnotationResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @param message VideoAnnotationResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoResponse. */ + interface IAnnotateVideoResponse { + + /** AnnotateVideoResponse annotationResults */ + annotationResults?: (google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults[]|null); + } + + /** Represents an AnnotateVideoResponse. */ + class AnnotateVideoResponse implements IAnnotateVideoResponse { + + /** + * Constructs a new AnnotateVideoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse); + + /** AnnotateVideoResponse annotationResults. */ + public annotationResults: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults[]; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoResponse instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse): google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoResponse + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.AnnotateVideoResponse; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoResponse + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.AnnotateVideoResponse; + + /** + * Verifies an AnnotateVideoResponse message. + * @param message Plain 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 AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @param message AnnotateVideoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationProgress. */ + interface IVideoAnnotationProgress { + + /** VideoAnnotationProgress inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationProgress progressPercent */ + progressPercent?: (number|null); + + /** VideoAnnotationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VideoAnnotationProgress. */ + class VideoAnnotationProgress implements IVideoAnnotationProgress { + + /** + * Constructs a new VideoAnnotationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress); + + /** VideoAnnotationProgress inputUri. */ + public inputUri: string; + + /** VideoAnnotationProgress progressPercent. */ + public progressPercent: number; + + /** VideoAnnotationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress): google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationProgress + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.VideoAnnotationProgress; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationProgress + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.VideoAnnotationProgress; + + /** + * Verifies a VideoAnnotationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @param message VideoAnnotationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoProgress. */ + interface IAnnotateVideoProgress { + + /** AnnotateVideoProgress annotationProgress */ + annotationProgress?: (google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress[]|null); + } + + /** Represents an AnnotateVideoProgress. */ + class AnnotateVideoProgress implements IAnnotateVideoProgress { + + /** + * Constructs a new AnnotateVideoProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress); + + /** AnnotateVideoProgress annotationProgress. */ + public annotationProgress: google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress[]; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress): google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoProgress + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.AnnotateVideoProgress; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoProgress + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.AnnotateVideoProgress; + + /** + * Verifies an AnnotateVideoProgress message. + * @param message Plain 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 AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @param message AnnotateVideoProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechTranscriptionConfig. */ + interface ISpeechTranscriptionConfig { + + /** SpeechTranscriptionConfig languageCode */ + languageCode?: (string|null); + + /** SpeechTranscriptionConfig maxAlternatives */ + maxAlternatives?: (number|null); + + /** SpeechTranscriptionConfig filterProfanity */ + filterProfanity?: (boolean|null); + + /** SpeechTranscriptionConfig speechContexts */ + speechContexts?: (google.cloud.videointelligence.v1p1beta1.ISpeechContext[]|null); + + /** SpeechTranscriptionConfig enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** SpeechTranscriptionConfig audioTracks */ + audioTracks?: (number[]|null); + } + + /** Represents a SpeechTranscriptionConfig. */ + class SpeechTranscriptionConfig implements ISpeechTranscriptionConfig { + + /** + * Constructs a new SpeechTranscriptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig); + + /** SpeechTranscriptionConfig languageCode. */ + public languageCode: string; + + /** SpeechTranscriptionConfig maxAlternatives. */ + public maxAlternatives: number; + + /** SpeechTranscriptionConfig filterProfanity. */ + public filterProfanity: boolean; + + /** SpeechTranscriptionConfig speechContexts. */ + public speechContexts: google.cloud.videointelligence.v1p1beta1.ISpeechContext[]; + + /** SpeechTranscriptionConfig enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** SpeechTranscriptionConfig audioTracks. */ + public audioTracks: number[]; + + /** + * Creates a new SpeechTranscriptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechTranscriptionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig): google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig; + + /** + * Encodes the specified SpeechTranscriptionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @param message SpeechTranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechTranscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @param message SpeechTranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechTranscriptionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.SpeechTranscriptionConfig; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechTranscriptionConfig + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.SpeechTranscriptionConfig; + + /** + * Verifies a SpeechTranscriptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechTranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechTranscriptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig; + + /** + * Creates a plain object from a SpeechTranscriptionConfig message. Also converts values to other types if specified. + * @param message SpeechTranscriptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechTranscriptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechTranscriptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechContext): google.cloud.videointelligence.v1p1beta1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechTranscription. */ + interface ISpeechTranscription { + + /** SpeechTranscription alternatives */ + alternatives?: (google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative[]|null); + } + + /** Represents a SpeechTranscription. */ + class SpeechTranscription implements ISpeechTranscription { + + /** + * Constructs a new SpeechTranscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechTranscription); + + /** SpeechTranscription alternatives. */ + public alternatives: google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative[]; + + /** + * Creates a new SpeechTranscription instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechTranscription instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechTranscription): google.cloud.videointelligence.v1p1beta1.SpeechTranscription; + + /** + * Encodes the specified SpeechTranscription message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscription.verify|verify} messages. + * @param message SpeechTranscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ISpeechTranscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechTranscription message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscription.verify|verify} messages. + * @param message SpeechTranscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ISpeechTranscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechTranscription + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.SpeechTranscription; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechTranscription + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.SpeechTranscription; + + /** + * Verifies a SpeechTranscription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechTranscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechTranscription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.SpeechTranscription; + + /** + * Creates a plain object from a SpeechTranscription message. Also converts values to other types if specified. + * @param message SpeechTranscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.SpeechTranscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechTranscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechTranscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.videointelligence.v1p1beta1.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.videointelligence.v1p1beta1.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative): google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startTime */ + startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime */ + endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p1beta1.IWordInfo); + + /** WordInfo startTime. */ + public startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime. */ + public endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.videointelligence.v1p1beta1.IWordInfo): google.cloud.videointelligence.v1p1beta1.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p1beta1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p1beta1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not 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.videointelligence.v1p1beta1.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload 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.videointelligence.v1p1beta1.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p1beta1.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p1beta1.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + LABEL_DETECTION = 1, + SHOT_CHANGE_DETECTION = 2, + EXPLICIT_CONTENT_DETECTION = 3, + SPEECH_TRANSCRIPTION = 6 + } + + /** LabelDetectionMode enum. */ + enum LabelDetectionMode { + LABEL_DETECTION_MODE_UNSPECIFIED = 0, + SHOT_MODE = 1, + FRAME_MODE = 2, + SHOT_AND_FRAME_MODE = 3 + } + + /** Likelihood enum. */ + enum Likelihood { + LIKELIHOOD_UNSPECIFIED = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + } + + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { + + /** Represents a VideoIntelligenceService */ + class VideoIntelligenceService extends $protobuf.rpc.Service { + + /** + * Constructs a new VideoIntelligenceService 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 VideoIntelligenceService 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): VideoIntelligenceService; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public annotateVideo(request: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, callback: google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService.AnnotateVideoCallback): void; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @returns Promise + */ + public annotateVideo(request: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest): Promise; + } + + namespace VideoIntelligenceService { + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService|annotateVideo}. + * @param error Error, if any + * @param [response] Operation + */ + type AnnotateVideoCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an AnnotateVideoRequest. */ + interface IAnnotateVideoRequest { + + /** AnnotateVideoRequest inputUri */ + inputUri?: (string|null); + + /** AnnotateVideoRequest inputContent */ + inputContent?: (Uint8Array|string|null); + + /** AnnotateVideoRequest features */ + features?: (google.cloud.videointelligence.v1p2beta1.Feature[]|null); + + /** AnnotateVideoRequest videoContext */ + videoContext?: (google.cloud.videointelligence.v1p2beta1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri */ + outputUri?: (string|null); + + /** AnnotateVideoRequest locationId */ + locationId?: (string|null); + } + + /** Represents an AnnotateVideoRequest. */ + class AnnotateVideoRequest implements IAnnotateVideoRequest { + + /** + * Constructs a new AnnotateVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest); + + /** AnnotateVideoRequest inputUri. */ + public inputUri: string; + + /** AnnotateVideoRequest inputContent. */ + public inputContent: (Uint8Array|string); + + /** AnnotateVideoRequest features. */ + public features: google.cloud.videointelligence.v1p2beta1.Feature[]; + + /** AnnotateVideoRequest videoContext. */ + public videoContext?: (google.cloud.videointelligence.v1p2beta1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri. */ + public outputUri: string; + + /** AnnotateVideoRequest locationId. */ + public locationId: string; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoRequest instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest): google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoRequest + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.AnnotateVideoRequest; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoRequest + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.AnnotateVideoRequest; + + /** + * Verifies an AnnotateVideoRequest message. + * @param message Plain 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 AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @param message AnnotateVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoContext. */ + interface IVideoContext { + + /** VideoContext segments */ + segments?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment[]|null); + + /** VideoContext labelDetectionConfig */ + labelDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig */ + shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig */ + explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig|null); + + /** VideoContext textDetectionConfig */ + textDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig|null); + } + + /** Represents a VideoContext. */ + class VideoContext implements IVideoContext { + + /** + * Constructs a new VideoContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IVideoContext); + + /** VideoContext segments. */ + public segments: google.cloud.videointelligence.v1p2beta1.IVideoSegment[]; + + /** VideoContext labelDetectionConfig. */ + public labelDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig. */ + public shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig. */ + public explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig|null); + + /** VideoContext textDetectionConfig. */ + public textDetectionConfig?: (google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig|null); + + /** + * Creates a new VideoContext instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IVideoContext): google.cloud.videointelligence.v1p2beta1.VideoContext; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoContext + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.VideoContext; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoContext + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.VideoContext; + + /** + * Verifies a VideoContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.VideoContext; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @param message VideoContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.VideoContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelDetectionConfig. */ + interface ILabelDetectionConfig { + + /** LabelDetectionConfig labelDetectionMode */ + labelDetectionMode?: (google.cloud.videointelligence.v1p2beta1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1p2beta1.LabelDetectionMode|null); + + /** LabelDetectionConfig stationaryCamera */ + stationaryCamera?: (boolean|null); + + /** LabelDetectionConfig model */ + model?: (string|null); + } + + /** Represents a LabelDetectionConfig. */ + class LabelDetectionConfig implements ILabelDetectionConfig { + + /** + * Constructs a new LabelDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig); + + /** LabelDetectionConfig labelDetectionMode. */ + public labelDetectionMode: (google.cloud.videointelligence.v1p2beta1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1p2beta1.LabelDetectionMode); + + /** LabelDetectionConfig stationaryCamera. */ + public stationaryCamera: boolean; + + /** LabelDetectionConfig model. */ + public model: string; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig): google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.LabelDetectionConfig; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.LabelDetectionConfig; + + /** + * Verifies a LabelDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @param message LabelDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShotChangeDetectionConfig. */ + interface IShotChangeDetectionConfig { + + /** ShotChangeDetectionConfig model */ + model?: (string|null); + } + + /** Represents a ShotChangeDetectionConfig. */ + class ShotChangeDetectionConfig implements IShotChangeDetectionConfig { + + /** + * Constructs a new ShotChangeDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig); + + /** ShotChangeDetectionConfig model. */ + public model: string; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShotChangeDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig): google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShotChangeDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @param message ShotChangeDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentDetectionConfig. */ + interface IExplicitContentDetectionConfig { + + /** ExplicitContentDetectionConfig model */ + model?: (string|null); + } + + /** Represents an ExplicitContentDetectionConfig. */ + class ExplicitContentDetectionConfig implements IExplicitContentDetectionConfig { + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig); + + /** ExplicitContentDetectionConfig model. */ + public model: string; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig): google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @param message Plain 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 ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @param message ExplicitContentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextDetectionConfig. */ + interface ITextDetectionConfig { + + /** TextDetectionConfig languageHints */ + languageHints?: (string[]|null); + } + + /** Represents a TextDetectionConfig. */ + class TextDetectionConfig implements ITextDetectionConfig { + + /** + * Constructs a new TextDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig); + + /** TextDetectionConfig languageHints. */ + public languageHints: string[]; + + /** + * Creates a new TextDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig): google.cloud.videointelligence.v1p2beta1.TextDetectionConfig; + + /** + * Encodes the specified TextDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.verify|verify} messages. + * @param message TextDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.verify|verify} messages. + * @param message TextDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.TextDetectionConfig; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.TextDetectionConfig; + + /** + * Verifies a TextDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.TextDetectionConfig; + + /** + * Creates a plain object from a TextDetectionConfig message. Also converts values to other types if specified. + * @param message TextDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.TextDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoSegment. */ + interface IVideoSegment { + + /** VideoSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoSegment. */ + class VideoSegment implements IVideoSegment { + + /** + * Constructs a new VideoSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IVideoSegment); + + /** VideoSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IVideoSegment): google.cloud.videointelligence.v1p2beta1.VideoSegment; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.VideoSegment; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoSegment + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.VideoSegment; + + /** + * Verifies a VideoSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.VideoSegment; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @param message VideoSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.VideoSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelSegment. */ + interface ILabelSegment { + + /** LabelSegment segment */ + segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** LabelSegment confidence */ + confidence?: (number|null); + } + + /** Represents a LabelSegment. */ + class LabelSegment implements ILabelSegment { + + /** + * Constructs a new LabelSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ILabelSegment); + + /** LabelSegment segment. */ + public segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** LabelSegment confidence. */ + public confidence: number; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ILabelSegment): google.cloud.videointelligence.v1p2beta1.LabelSegment; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.LabelSegment; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSegment + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.LabelSegment; + + /** + * Verifies a LabelSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.LabelSegment; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @param message LabelSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.LabelSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelFrame. */ + interface ILabelFrame { + + /** LabelFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence */ + confidence?: (number|null); + } + + /** Represents a LabelFrame. */ + class LabelFrame implements ILabelFrame { + + /** + * Constructs a new LabelFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ILabelFrame); + + /** LabelFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence. */ + public confidence: number; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ILabelFrame): google.cloud.videointelligence.v1p2beta1.LabelFrame; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.LabelFrame; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelFrame + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.LabelFrame; + + /** + * Verifies a LabelFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.LabelFrame; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @param message LabelFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.LabelFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity entityId */ + entityId?: (string|null); + + /** Entity description */ + description?: (string|null); + + /** Entity languageCode */ + languageCode?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IEntity); + + /** Entity entityId. */ + public entityId: string; + + /** Entity description. */ + public description: string; + + /** Entity languageCode. */ + public languageCode: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IEntity): google.cloud.videointelligence.v1p2beta1.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelAnnotation. */ + interface ILabelAnnotation { + + /** LabelAnnotation entity */ + entity?: (google.cloud.videointelligence.v1p2beta1.IEntity|null); + + /** LabelAnnotation categoryEntities */ + categoryEntities?: (google.cloud.videointelligence.v1p2beta1.IEntity[]|null); + + /** LabelAnnotation segments */ + segments?: (google.cloud.videointelligence.v1p2beta1.ILabelSegment[]|null); + + /** LabelAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p2beta1.ILabelFrame[]|null); + } + + /** Represents a LabelAnnotation. */ + class LabelAnnotation implements ILabelAnnotation { + + /** + * Constructs a new LabelAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation); + + /** LabelAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1p2beta1.IEntity|null); + + /** LabelAnnotation categoryEntities. */ + public categoryEntities: google.cloud.videointelligence.v1p2beta1.IEntity[]; + + /** LabelAnnotation segments. */ + public segments: google.cloud.videointelligence.v1p2beta1.ILabelSegment[]; + + /** LabelAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p2beta1.ILabelFrame[]; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation): google.cloud.videointelligence.v1p2beta1.LabelAnnotation; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.LabelAnnotation; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.LabelAnnotation; + + /** + * Verifies a LabelAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.LabelAnnotation; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @param message LabelAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.LabelAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentFrame. */ + interface IExplicitContentFrame { + + /** ExplicitContentFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood */ + pornographyLikelihood?: (google.cloud.videointelligence.v1p2beta1.Likelihood|keyof typeof google.cloud.videointelligence.v1p2beta1.Likelihood|null); + } + + /** Represents an ExplicitContentFrame. */ + class ExplicitContentFrame implements IExplicitContentFrame { + + /** + * Constructs a new ExplicitContentFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame); + + /** ExplicitContentFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood. */ + public pornographyLikelihood: (google.cloud.videointelligence.v1p2beta1.Likelihood|keyof typeof google.cloud.videointelligence.v1p2beta1.Likelihood); + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame): google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.ExplicitContentFrame; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentFrame + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.ExplicitContentFrame; + + /** + * Verifies an ExplicitContentFrame message. + * @param message Plain 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 ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @param message ExplicitContentFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentAnnotation. */ + interface IExplicitContentAnnotation { + + /** ExplicitContentAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame[]|null); + } + + /** Represents an ExplicitContentAnnotation. */ + class ExplicitContentAnnotation implements IExplicitContentAnnotation { + + /** + * Constructs a new ExplicitContentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation); + + /** ExplicitContentAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame[]; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation): google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.ExplicitContentAnnotation; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.ExplicitContentAnnotation; + + /** + * Verifies an ExplicitContentAnnotation message. + * @param message Plain 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 ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @param message ExplicitContentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox left */ + left?: (number|null); + + /** NormalizedBoundingBox top */ + top?: (number|null); + + /** NormalizedBoundingBox right */ + right?: (number|null); + + /** NormalizedBoundingBox bottom */ + bottom?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox); + + /** NormalizedBoundingBox left. */ + public left: number; + + /** NormalizedBoundingBox top. */ + public top: number; + + /** NormalizedBoundingBox right. */ + public right: number; + + /** NormalizedBoundingBox bottom. */ + public bottom: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox): google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationResults. */ + interface IVideoAnnotationResults { + + /** VideoAnnotationResults inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationResults segmentLabelAnnotations */ + segmentLabelAnnotations?: (google.cloud.videointelligence.v1p2beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotLabelAnnotations */ + shotLabelAnnotations?: (google.cloud.videointelligence.v1p2beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults frameLabelAnnotations */ + frameLabelAnnotations?: (google.cloud.videointelligence.v1p2beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotAnnotations */ + shotAnnotations?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment[]|null); + + /** VideoAnnotationResults explicitAnnotation */ + explicitAnnotation?: (google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults textAnnotations */ + textAnnotations?: (google.cloud.videointelligence.v1p2beta1.ITextAnnotation[]|null); + + /** VideoAnnotationResults objectAnnotations */ + objectAnnotations?: (google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation[]|null); + + /** VideoAnnotationResults error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a VideoAnnotationResults. */ + class VideoAnnotationResults implements IVideoAnnotationResults { + + /** + * Constructs a new VideoAnnotationResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults); + + /** VideoAnnotationResults inputUri. */ + public inputUri: string; + + /** VideoAnnotationResults segmentLabelAnnotations. */ + public segmentLabelAnnotations: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotLabelAnnotations. */ + public shotLabelAnnotations: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults frameLabelAnnotations. */ + public frameLabelAnnotations: google.cloud.videointelligence.v1p2beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotAnnotations. */ + public shotAnnotations: google.cloud.videointelligence.v1p2beta1.IVideoSegment[]; + + /** VideoAnnotationResults explicitAnnotation. */ + public explicitAnnotation?: (google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults textAnnotations. */ + public textAnnotations: google.cloud.videointelligence.v1p2beta1.ITextAnnotation[]; + + /** VideoAnnotationResults objectAnnotations. */ + public objectAnnotations: google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation[]; + + /** VideoAnnotationResults error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationResults instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults): google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationResults + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.VideoAnnotationResults; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationResults + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.VideoAnnotationResults; + + /** + * Verifies a VideoAnnotationResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @param message VideoAnnotationResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoResponse. */ + interface IAnnotateVideoResponse { + + /** AnnotateVideoResponse annotationResults */ + annotationResults?: (google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults[]|null); + } + + /** Represents an AnnotateVideoResponse. */ + class AnnotateVideoResponse implements IAnnotateVideoResponse { + + /** + * Constructs a new AnnotateVideoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse); + + /** AnnotateVideoResponse annotationResults. */ + public annotationResults: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults[]; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoResponse instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse): google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoResponse + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.AnnotateVideoResponse; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoResponse + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.AnnotateVideoResponse; + + /** + * Verifies an AnnotateVideoResponse message. + * @param message Plain 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 AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @param message AnnotateVideoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationProgress. */ + interface IVideoAnnotationProgress { + + /** VideoAnnotationProgress inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationProgress progressPercent */ + progressPercent?: (number|null); + + /** VideoAnnotationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a VideoAnnotationProgress. */ + class VideoAnnotationProgress implements IVideoAnnotationProgress { + + /** + * Constructs a new VideoAnnotationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress); + + /** VideoAnnotationProgress inputUri. */ + public inputUri: string; + + /** VideoAnnotationProgress progressPercent. */ + public progressPercent: number; + + /** VideoAnnotationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress): google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationProgress + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.VideoAnnotationProgress; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationProgress + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.VideoAnnotationProgress; + + /** + * Verifies a VideoAnnotationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @param message VideoAnnotationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoProgress. */ + interface IAnnotateVideoProgress { + + /** AnnotateVideoProgress annotationProgress */ + annotationProgress?: (google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress[]|null); + } + + /** Represents an AnnotateVideoProgress. */ + class AnnotateVideoProgress implements IAnnotateVideoProgress { + + /** + * Constructs a new AnnotateVideoProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress); + + /** AnnotateVideoProgress annotationProgress. */ + public annotationProgress: google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress[]; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress): google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoProgress + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.AnnotateVideoProgress; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoProgress + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.AnnotateVideoProgress; + + /** + * Verifies an AnnotateVideoProgress message. + * @param message Plain 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 AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @param message AnnotateVideoProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.INormalizedVertex): google.cloud.videointelligence.v1p2beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingPoly. */ + interface INormalizedBoundingPoly { + + /** NormalizedBoundingPoly vertices */ + vertices?: (google.cloud.videointelligence.v1p2beta1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedBoundingPoly. */ + class NormalizedBoundingPoly implements INormalizedBoundingPoly { + + /** + * Constructs a new NormalizedBoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly); + + /** NormalizedBoundingPoly vertices. */ + public vertices: google.cloud.videointelligence.v1p2beta1.INormalizedVertex[]; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingPoly instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly): google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.NormalizedBoundingPoly; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.NormalizedBoundingPoly; + + /** + * Verifies a NormalizedBoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @param message NormalizedBoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingPoly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment segment */ + segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** TextSegment confidence */ + confidence?: (number|null); + + /** TextSegment frames */ + frames?: (google.cloud.videointelligence.v1p2beta1.ITextFrame[]|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ITextSegment); + + /** TextSegment segment. */ + public segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** TextSegment confidence. */ + public confidence: number; + + /** TextSegment frames. */ + public frames: google.cloud.videointelligence.v1p2beta1.ITextFrame[]; + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ITextSegment): google.cloud.videointelligence.v1p2beta1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextFrame. */ + interface ITextFrame { + + /** TextFrame rotatedBoundingBox */ + rotatedBoundingBox?: (google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly|null); + + /** TextFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a TextFrame. */ + class TextFrame implements ITextFrame { + + /** + * Constructs a new TextFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ITextFrame); + + /** TextFrame rotatedBoundingBox. */ + public rotatedBoundingBox?: (google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly|null); + + /** TextFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new TextFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns TextFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ITextFrame): google.cloud.videointelligence.v1p2beta1.TextFrame; + + /** + * Encodes the specified TextFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextFrame.verify|verify} messages. + * @param message TextFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ITextFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextFrame.verify|verify} messages. + * @param message TextFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ITextFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.TextFrame; + + /** + * Decodes a TextFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextFrame + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.TextFrame; + + /** + * Verifies a TextFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.TextFrame; + + /** + * Creates a plain object from a TextFrame message. Also converts values to other types if specified. + * @param message TextFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.TextFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation text */ + text?: (string|null); + + /** TextAnnotation segments */ + segments?: (google.cloud.videointelligence.v1p2beta1.ITextSegment[]|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.ITextAnnotation); + + /** TextAnnotation text. */ + public text: string; + + /** TextAnnotation segments. */ + public segments: google.cloud.videointelligence.v1p2beta1.ITextSegment[]; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.ITextAnnotation): google.cloud.videointelligence.v1p2beta1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingFrame. */ + interface IObjectTrackingFrame { + + /** ObjectTrackingFrame normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox|null); + + /** ObjectTrackingFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an ObjectTrackingFrame. */ + class ObjectTrackingFrame implements IObjectTrackingFrame { + + /** + * Constructs a new ObjectTrackingFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame); + + /** ObjectTrackingFrame normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox|null); + + /** ObjectTrackingFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame): google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.verify|verify} messages. + * @param message ObjectTrackingFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.verify|verify} messages. + * @param message ObjectTrackingFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.ObjectTrackingFrame; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingFrame + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.ObjectTrackingFrame; + + /** + * Verifies an ObjectTrackingFrame message. + * @param message Plain 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 ObjectTrackingFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame; + + /** + * Creates a plain object from an ObjectTrackingFrame message. Also converts values to other types if specified. + * @param message ObjectTrackingFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingAnnotation. */ + interface IObjectTrackingAnnotation { + + /** ObjectTrackingAnnotation segment */ + segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId */ + trackId?: (number|Long|string|null); + + /** ObjectTrackingAnnotation entity */ + entity?: (google.cloud.videointelligence.v1p2beta1.IEntity|null); + + /** ObjectTrackingAnnotation confidence */ + confidence?: (number|null); + + /** ObjectTrackingAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame[]|null); + } + + /** Represents an ObjectTrackingAnnotation. */ + class ObjectTrackingAnnotation implements IObjectTrackingAnnotation { + + /** + * Constructs a new ObjectTrackingAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation); + + /** ObjectTrackingAnnotation segment. */ + public segment?: (google.cloud.videointelligence.v1p2beta1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId. */ + public trackId?: (number|Long|string|null); + + /** ObjectTrackingAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1p2beta1.IEntity|null); + + /** ObjectTrackingAnnotation confidence. */ + public confidence: number; + + /** ObjectTrackingAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame[]; + + /** ObjectTrackingAnnotation trackInfo. */ + public trackInfo?: ("segment"|"trackId"); + + /** + * Creates a new ObjectTrackingAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation): google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation; + + /** + * Encodes the specified ObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @param message ObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @param message ObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation; + + /** + * Verifies an ObjectTrackingAnnotation message. + * @param message Plain 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 ObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation; + + /** + * Creates a plain object from an ObjectTrackingAnnotation message. Also converts values to other types if specified. + * @param message ObjectTrackingAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + LABEL_DETECTION = 1, + SHOT_CHANGE_DETECTION = 2, + EXPLICIT_CONTENT_DETECTION = 3, + TEXT_DETECTION = 7, + OBJECT_TRACKING = 9 + } + + /** LabelDetectionMode enum. */ + enum LabelDetectionMode { + LABEL_DETECTION_MODE_UNSPECIFIED = 0, + SHOT_MODE = 1, + FRAME_MODE = 2, + SHOT_AND_FRAME_MODE = 3 + } + + /** Likelihood enum. */ + enum Likelihood { + LIKELIHOOD_UNSPECIFIED = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + } + + /** Namespace v1p3beta1. */ + namespace v1p3beta1 { + + /** Represents a VideoIntelligenceService */ + class VideoIntelligenceService extends $protobuf.rpc.Service { + + /** + * Constructs a new VideoIntelligenceService 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 VideoIntelligenceService 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): VideoIntelligenceService; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public annotateVideo(request: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, callback: google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService.AnnotateVideoCallback): void; + + /** + * Calls AnnotateVideo. + * @param request AnnotateVideoRequest message or plain object + * @returns Promise + */ + public annotateVideo(request: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest): Promise; + } + + namespace VideoIntelligenceService { + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService|annotateVideo}. + * @param error Error, if any + * @param [response] Operation + */ + type AnnotateVideoCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Represents a StreamingVideoIntelligenceService */ + class StreamingVideoIntelligenceService extends $protobuf.rpc.Service { + + /** + * Constructs a new StreamingVideoIntelligenceService 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 StreamingVideoIntelligenceService 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): StreamingVideoIntelligenceService; + + /** + * Calls StreamingAnnotateVideo. + * @param request StreamingAnnotateVideoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingAnnotateVideoResponse + */ + public streamingAnnotateVideo(request: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest, callback: google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService.StreamingAnnotateVideoCallback): void; + + /** + * Calls StreamingAnnotateVideo. + * @param request StreamingAnnotateVideoRequest message or plain object + * @returns Promise + */ + public streamingAnnotateVideo(request: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest): Promise; + } + + namespace StreamingVideoIntelligenceService { + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService|streamingAnnotateVideo}. + * @param error Error, if any + * @param [response] StreamingAnnotateVideoResponse + */ + type StreamingAnnotateVideoCallback = (error: (Error|null), response?: google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse) => void; + } + + /** Properties of an AnnotateVideoRequest. */ + interface IAnnotateVideoRequest { + + /** AnnotateVideoRequest inputUri */ + inputUri?: (string|null); + + /** AnnotateVideoRequest inputContent */ + inputContent?: (Uint8Array|string|null); + + /** AnnotateVideoRequest features */ + features?: (google.cloud.videointelligence.v1p3beta1.Feature[]|null); + + /** AnnotateVideoRequest videoContext */ + videoContext?: (google.cloud.videointelligence.v1p3beta1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri */ + outputUri?: (string|null); + + /** AnnotateVideoRequest locationId */ + locationId?: (string|null); + } + + /** Represents an AnnotateVideoRequest. */ + class AnnotateVideoRequest implements IAnnotateVideoRequest { + + /** + * Constructs a new AnnotateVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest); + + /** AnnotateVideoRequest inputUri. */ + public inputUri: string; + + /** AnnotateVideoRequest inputContent. */ + public inputContent: (Uint8Array|string); + + /** AnnotateVideoRequest features. */ + public features: google.cloud.videointelligence.v1p3beta1.Feature[]; + + /** AnnotateVideoRequest videoContext. */ + public videoContext?: (google.cloud.videointelligence.v1p3beta1.IVideoContext|null); + + /** AnnotateVideoRequest outputUri. */ + public outputUri: string; + + /** AnnotateVideoRequest locationId. */ + public locationId: string; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoRequest instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest): google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.verify|verify} messages. + * @param message AnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoRequest + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.AnnotateVideoRequest; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoRequest + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.AnnotateVideoRequest; + + /** + * Verifies an AnnotateVideoRequest message. + * @param message Plain 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 AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @param message AnnotateVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoContext. */ + interface IVideoContext { + + /** VideoContext segments */ + segments?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment[]|null); + + /** VideoContext labelDetectionConfig */ + labelDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig */ + shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig */ + explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig|null); + + /** VideoContext faceDetectionConfig */ + faceDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig|null); + + /** VideoContext speechTranscriptionConfig */ + speechTranscriptionConfig?: (google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig|null); + + /** VideoContext textDetectionConfig */ + textDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig|null); + + /** VideoContext personDetectionConfig */ + personDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig|null); + + /** VideoContext objectTrackingConfig */ + objectTrackingConfig?: (google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig|null); + } + + /** Represents a VideoContext. */ + class VideoContext implements IVideoContext { + + /** + * Constructs a new VideoContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IVideoContext); + + /** VideoContext segments. */ + public segments: google.cloud.videointelligence.v1p3beta1.IVideoSegment[]; + + /** VideoContext labelDetectionConfig. */ + public labelDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig|null); + + /** VideoContext shotChangeDetectionConfig. */ + public shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig|null); + + /** VideoContext explicitContentDetectionConfig. */ + public explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig|null); + + /** VideoContext faceDetectionConfig. */ + public faceDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig|null); + + /** VideoContext speechTranscriptionConfig. */ + public speechTranscriptionConfig?: (google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig|null); + + /** VideoContext textDetectionConfig. */ + public textDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig|null); + + /** VideoContext personDetectionConfig. */ + public personDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig|null); + + /** VideoContext objectTrackingConfig. */ + public objectTrackingConfig?: (google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig|null); + + /** + * Creates a new VideoContext instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IVideoContext): google.cloud.videointelligence.v1p3beta1.VideoContext; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoContext.verify|verify} messages. + * @param message VideoContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IVideoContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoContext + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.VideoContext; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoContext + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.VideoContext; + + /** + * Verifies a VideoContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.VideoContext; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @param message VideoContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.VideoContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LabelDetectionMode enum. */ + enum LabelDetectionMode { + LABEL_DETECTION_MODE_UNSPECIFIED = 0, + SHOT_MODE = 1, + FRAME_MODE = 2, + SHOT_AND_FRAME_MODE = 3 + } + + /** Likelihood enum. */ + enum Likelihood { + LIKELIHOOD_UNSPECIFIED = 0, + VERY_UNLIKELY = 1, + UNLIKELY = 2, + POSSIBLE = 3, + LIKELY = 4, + VERY_LIKELY = 5 + } + + /** Properties of a LabelDetectionConfig. */ + interface ILabelDetectionConfig { + + /** LabelDetectionConfig labelDetectionMode */ + labelDetectionMode?: (google.cloud.videointelligence.v1p3beta1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1p3beta1.LabelDetectionMode|null); + + /** LabelDetectionConfig stationaryCamera */ + stationaryCamera?: (boolean|null); + + /** LabelDetectionConfig model */ + model?: (string|null); + + /** LabelDetectionConfig frameConfidenceThreshold */ + frameConfidenceThreshold?: (number|null); + + /** LabelDetectionConfig videoConfidenceThreshold */ + videoConfidenceThreshold?: (number|null); + } + + /** Represents a LabelDetectionConfig. */ + class LabelDetectionConfig implements ILabelDetectionConfig { + + /** + * Constructs a new LabelDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig); + + /** LabelDetectionConfig labelDetectionMode. */ + public labelDetectionMode: (google.cloud.videointelligence.v1p3beta1.LabelDetectionMode|keyof typeof google.cloud.videointelligence.v1p3beta1.LabelDetectionMode); + + /** LabelDetectionConfig stationaryCamera. */ + public stationaryCamera: boolean; + + /** LabelDetectionConfig model. */ + public model: string; + + /** LabelDetectionConfig frameConfidenceThreshold. */ + public frameConfidenceThreshold: number; + + /** LabelDetectionConfig videoConfidenceThreshold. */ + public videoConfidenceThreshold: number; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig): google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.verify|verify} messages. + * @param message LabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.LabelDetectionConfig; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.LabelDetectionConfig; + + /** + * Verifies a LabelDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @param message LabelDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** StreamingFeature enum. */ + enum StreamingFeature { + STREAMING_FEATURE_UNSPECIFIED = 0, + STREAMING_LABEL_DETECTION = 1, + STREAMING_SHOT_CHANGE_DETECTION = 2, + STREAMING_EXPLICIT_CONTENT_DETECTION = 3, + STREAMING_OBJECT_TRACKING = 4, + STREAMING_AUTOML_ACTION_RECOGNITION = 23, + STREAMING_AUTOML_CLASSIFICATION = 21, + STREAMING_AUTOML_OBJECT_TRACKING = 22 + } + + /** Feature enum. */ + enum Feature { + FEATURE_UNSPECIFIED = 0, + LABEL_DETECTION = 1, + SHOT_CHANGE_DETECTION = 2, + EXPLICIT_CONTENT_DETECTION = 3, + FACE_DETECTION = 4, + SPEECH_TRANSCRIPTION = 6, + TEXT_DETECTION = 7, + OBJECT_TRACKING = 9, + LOGO_RECOGNITION = 12, + CELEBRITY_RECOGNITION = 13, + PERSON_DETECTION = 14 + } + + /** Properties of a ShotChangeDetectionConfig. */ + interface IShotChangeDetectionConfig { + + /** ShotChangeDetectionConfig model */ + model?: (string|null); + } + + /** Represents a ShotChangeDetectionConfig. */ + class ShotChangeDetectionConfig implements IShotChangeDetectionConfig { + + /** + * Constructs a new ShotChangeDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig); + + /** ShotChangeDetectionConfig model. */ + public model: string; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShotChangeDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig): google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @param message ShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ShotChangeDetectionConfig; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShotChangeDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ShotChangeDetectionConfig; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShotChangeDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @param message ShotChangeDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingConfig. */ + interface IObjectTrackingConfig { + + /** ObjectTrackingConfig model */ + model?: (string|null); + } + + /** Represents an ObjectTrackingConfig. */ + class ObjectTrackingConfig implements IObjectTrackingConfig { + + /** + * Constructs a new ObjectTrackingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig); + + /** ObjectTrackingConfig model. */ + public model: string; + + /** + * Creates a new ObjectTrackingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig): google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig; + + /** + * Encodes the specified ObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.verify|verify} messages. + * @param message ObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.verify|verify} messages. + * @param message ObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ObjectTrackingConfig; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ObjectTrackingConfig; + + /** + * Verifies an ObjectTrackingConfig message. + * @param message Plain 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 ObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig; + + /** + * Creates a plain object from an ObjectTrackingConfig message. Also converts values to other types if specified. + * @param message ObjectTrackingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentDetectionConfig. */ + interface IExplicitContentDetectionConfig { + + /** ExplicitContentDetectionConfig model */ + model?: (string|null); + } + + /** Represents an ExplicitContentDetectionConfig. */ + class ExplicitContentDetectionConfig implements IExplicitContentDetectionConfig { + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig); + + /** ExplicitContentDetectionConfig model. */ + public model: string; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig): google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @param message ExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ExplicitContentDetectionConfig; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ExplicitContentDetectionConfig; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @param message Plain 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 ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @param message ExplicitContentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceDetectionConfig. */ + interface IFaceDetectionConfig { + + /** FaceDetectionConfig model */ + model?: (string|null); + + /** FaceDetectionConfig includeBoundingBoxes */ + includeBoundingBoxes?: (boolean|null); + + /** FaceDetectionConfig includeAttributes */ + includeAttributes?: (boolean|null); + } + + /** Represents a FaceDetectionConfig. */ + class FaceDetectionConfig implements IFaceDetectionConfig { + + /** + * Constructs a new FaceDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig); + + /** FaceDetectionConfig model. */ + public model: string; + + /** FaceDetectionConfig includeBoundingBoxes. */ + public includeBoundingBoxes: boolean; + + /** FaceDetectionConfig includeAttributes. */ + public includeAttributes: boolean; + + /** + * Creates a new FaceDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig): google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig; + + /** + * Encodes the specified FaceDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.verify|verify} messages. + * @param message FaceDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.verify|verify} messages. + * @param message FaceDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.FaceDetectionConfig; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.FaceDetectionConfig; + + /** + * Verifies a FaceDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig; + + /** + * Creates a plain object from a FaceDetectionConfig message. Also converts values to other types if specified. + * @param message FaceDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonDetectionConfig. */ + interface IPersonDetectionConfig { + + /** PersonDetectionConfig includeBoundingBoxes */ + includeBoundingBoxes?: (boolean|null); + + /** PersonDetectionConfig includePoseLandmarks */ + includePoseLandmarks?: (boolean|null); + + /** PersonDetectionConfig includeAttributes */ + includeAttributes?: (boolean|null); + } + + /** Represents a PersonDetectionConfig. */ + class PersonDetectionConfig implements IPersonDetectionConfig { + + /** + * Constructs a new PersonDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig); + + /** PersonDetectionConfig includeBoundingBoxes. */ + public includeBoundingBoxes: boolean; + + /** PersonDetectionConfig includePoseLandmarks. */ + public includePoseLandmarks: boolean; + + /** PersonDetectionConfig includeAttributes. */ + public includeAttributes: boolean; + + /** + * Creates a new PersonDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig): google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig; + + /** + * Encodes the specified PersonDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.verify|verify} messages. + * @param message PersonDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.verify|verify} messages. + * @param message PersonDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.PersonDetectionConfig; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.PersonDetectionConfig; + + /** + * Verifies a PersonDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig; + + /** + * Creates a plain object from a PersonDetectionConfig message. Also converts values to other types if specified. + * @param message PersonDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextDetectionConfig. */ + interface ITextDetectionConfig { + + /** TextDetectionConfig languageHints */ + languageHints?: (string[]|null); + + /** TextDetectionConfig model */ + model?: (string|null); + } + + /** Represents a TextDetectionConfig. */ + class TextDetectionConfig implements ITextDetectionConfig { + + /** + * Constructs a new TextDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig); + + /** TextDetectionConfig languageHints. */ + public languageHints: string[]; + + /** TextDetectionConfig model. */ + public model: string; + + /** + * Creates a new TextDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TextDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig): google.cloud.videointelligence.v1p3beta1.TextDetectionConfig; + + /** + * Encodes the specified TextDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.verify|verify} messages. + * @param message TextDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.verify|verify} messages. + * @param message TextDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.TextDetectionConfig; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.TextDetectionConfig; + + /** + * Verifies a TextDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.TextDetectionConfig; + + /** + * Creates a plain object from a TextDetectionConfig message. Also converts values to other types if specified. + * @param message TextDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.TextDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoSegment. */ + interface IVideoSegment { + + /** VideoSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoSegment. */ + class VideoSegment implements IVideoSegment { + + /** + * Constructs a new VideoSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IVideoSegment); + + /** VideoSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** VideoSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IVideoSegment): google.cloud.videointelligence.v1p3beta1.VideoSegment; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoSegment.verify|verify} messages. + * @param message VideoSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IVideoSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.VideoSegment; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoSegment + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.VideoSegment; + + /** + * Verifies a VideoSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.VideoSegment; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @param message VideoSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.VideoSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelSegment. */ + interface ILabelSegment { + + /** LabelSegment segment */ + segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** LabelSegment confidence */ + confidence?: (number|null); + } + + /** Represents a LabelSegment. */ + class LabelSegment implements ILabelSegment { + + /** + * Constructs a new LabelSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ILabelSegment); + + /** LabelSegment segment. */ + public segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** LabelSegment confidence. */ + public confidence: number; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ILabelSegment): google.cloud.videointelligence.v1p3beta1.LabelSegment; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelSegment.verify|verify} messages. + * @param message LabelSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ILabelSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.LabelSegment; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSegment + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.LabelSegment; + + /** + * Verifies a LabelSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.LabelSegment; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @param message LabelSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.LabelSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelFrame. */ + interface ILabelFrame { + + /** LabelFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence */ + confidence?: (number|null); + } + + /** Represents a LabelFrame. */ + class LabelFrame implements ILabelFrame { + + /** + * Constructs a new LabelFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ILabelFrame); + + /** LabelFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** LabelFrame confidence. */ + public confidence: number; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ILabelFrame): google.cloud.videointelligence.v1p3beta1.LabelFrame; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelFrame.verify|verify} messages. + * @param message LabelFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ILabelFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.LabelFrame; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelFrame + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.LabelFrame; + + /** + * Verifies a LabelFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.LabelFrame; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @param message LabelFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.LabelFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity entityId */ + entityId?: (string|null); + + /** Entity description */ + description?: (string|null); + + /** Entity languageCode */ + languageCode?: (string|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IEntity); + + /** Entity entityId. */ + public entityId: string; + + /** Entity description. */ + public description: string; + + /** Entity languageCode. */ + public languageCode: string; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IEntity): google.cloud.videointelligence.v1p3beta1.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.Entity; + + /** + * Verifies an Entity message. + * @param message Plain 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 Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelAnnotation. */ + interface ILabelAnnotation { + + /** LabelAnnotation entity */ + entity?: (google.cloud.videointelligence.v1p3beta1.IEntity|null); + + /** LabelAnnotation categoryEntities */ + categoryEntities?: (google.cloud.videointelligence.v1p3beta1.IEntity[]|null); + + /** LabelAnnotation segments */ + segments?: (google.cloud.videointelligence.v1p3beta1.ILabelSegment[]|null); + + /** LabelAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p3beta1.ILabelFrame[]|null); + } + + /** Represents a LabelAnnotation. */ + class LabelAnnotation implements ILabelAnnotation { + + /** + * Constructs a new LabelAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation); + + /** LabelAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1p3beta1.IEntity|null); + + /** LabelAnnotation categoryEntities. */ + public categoryEntities: google.cloud.videointelligence.v1p3beta1.IEntity[]; + + /** LabelAnnotation segments. */ + public segments: google.cloud.videointelligence.v1p3beta1.ILabelSegment[]; + + /** LabelAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p3beta1.ILabelFrame[]; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation): google.cloud.videointelligence.v1p3beta1.LabelAnnotation; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify|verify} messages. + * @param message LabelAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.LabelAnnotation; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.LabelAnnotation; + + /** + * Verifies a LabelAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.LabelAnnotation; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @param message LabelAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.LabelAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentFrame. */ + interface IExplicitContentFrame { + + /** ExplicitContentFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood */ + pornographyLikelihood?: (google.cloud.videointelligence.v1p3beta1.Likelihood|keyof typeof google.cloud.videointelligence.v1p3beta1.Likelihood|null); + } + + /** Represents an ExplicitContentFrame. */ + class ExplicitContentFrame implements IExplicitContentFrame { + + /** + * Constructs a new ExplicitContentFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame); + + /** ExplicitContentFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** ExplicitContentFrame pornographyLikelihood. */ + public pornographyLikelihood: (google.cloud.videointelligence.v1p3beta1.Likelihood|keyof typeof google.cloud.videointelligence.v1p3beta1.Likelihood); + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame): google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.verify|verify} messages. + * @param message ExplicitContentFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ExplicitContentFrame; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentFrame + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ExplicitContentFrame; + + /** + * Verifies an ExplicitContentFrame message. + * @param message Plain 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 ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @param message ExplicitContentFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplicitContentAnnotation. */ + interface IExplicitContentAnnotation { + + /** ExplicitContentAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame[]|null); + } + + /** Represents an ExplicitContentAnnotation. */ + class ExplicitContentAnnotation implements IExplicitContentAnnotation { + + /** + * Constructs a new ExplicitContentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation); + + /** ExplicitContentAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame[]; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplicitContentAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation): google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.verify|verify} messages. + * @param message ExplicitContentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ExplicitContentAnnotation; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplicitContentAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ExplicitContentAnnotation; + + /** + * Verifies an ExplicitContentAnnotation message. + * @param message Plain 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 ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplicitContentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @param message ExplicitContentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingBox. */ + interface INormalizedBoundingBox { + + /** NormalizedBoundingBox left */ + left?: (number|null); + + /** NormalizedBoundingBox top */ + top?: (number|null); + + /** NormalizedBoundingBox right */ + right?: (number|null); + + /** NormalizedBoundingBox bottom */ + bottom?: (number|null); + } + + /** Represents a NormalizedBoundingBox. */ + class NormalizedBoundingBox implements INormalizedBoundingBox { + + /** + * Constructs a new NormalizedBoundingBox. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox); + + /** NormalizedBoundingBox left. */ + public left: number; + + /** NormalizedBoundingBox top. */ + public top: number; + + /** NormalizedBoundingBox right. */ + public right: number; + + /** NormalizedBoundingBox bottom. */ + public bottom: number; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingBox instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox): google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.verify|verify} messages. + * @param message NormalizedBoundingBox message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingBox + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.NormalizedBoundingBox; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingBox + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.NormalizedBoundingBox; + + /** + * Verifies a NormalizedBoundingBox message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingBox + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @param message NormalizedBoundingBox + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampedObject. */ + interface ITimestampedObject { + + /** TimestampedObject normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null); + + /** TimestampedObject timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** TimestampedObject attributes */ + attributes?: (google.cloud.videointelligence.v1p3beta1.IDetectedAttribute[]|null); + + /** TimestampedObject landmarks */ + landmarks?: (google.cloud.videointelligence.v1p3beta1.IDetectedLandmark[]|null); + } + + /** Represents a TimestampedObject. */ + class TimestampedObject implements ITimestampedObject { + + /** + * Constructs a new TimestampedObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ITimestampedObject); + + /** TimestampedObject normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null); + + /** TimestampedObject timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** TimestampedObject attributes. */ + public attributes: google.cloud.videointelligence.v1p3beta1.IDetectedAttribute[]; + + /** TimestampedObject landmarks. */ + public landmarks: google.cloud.videointelligence.v1p3beta1.IDetectedLandmark[]; + + /** + * Creates a new TimestampedObject instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampedObject instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ITimestampedObject): google.cloud.videointelligence.v1p3beta1.TimestampedObject; + + /** + * Encodes the specified TimestampedObject message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TimestampedObject.verify|verify} messages. + * @param message TimestampedObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ITimestampedObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampedObject message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TimestampedObject.verify|verify} messages. + * @param message TimestampedObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ITimestampedObject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampedObject + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.TimestampedObject; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampedObject + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.TimestampedObject; + + /** + * Verifies a TimestampedObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampedObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampedObject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.TimestampedObject; + + /** + * Creates a plain object from a TimestampedObject message. Also converts values to other types if specified. + * @param message TimestampedObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.TimestampedObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampedObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampedObject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Track. */ + interface ITrack { + + /** Track segment */ + segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** Track timestampedObjects */ + timestampedObjects?: (google.cloud.videointelligence.v1p3beta1.ITimestampedObject[]|null); + + /** Track attributes */ + attributes?: (google.cloud.videointelligence.v1p3beta1.IDetectedAttribute[]|null); + + /** Track confidence */ + confidence?: (number|null); + } + + /** Represents a Track. */ + class Track implements ITrack { + + /** + * Constructs a new Track. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ITrack); + + /** Track segment. */ + public segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** Track timestampedObjects. */ + public timestampedObjects: google.cloud.videointelligence.v1p3beta1.ITimestampedObject[]; + + /** Track attributes. */ + public attributes: google.cloud.videointelligence.v1p3beta1.IDetectedAttribute[]; + + /** Track confidence. */ + public confidence: number; + + /** + * Creates a new Track instance using the specified properties. + * @param [properties] Properties to set + * @returns Track instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ITrack): google.cloud.videointelligence.v1p3beta1.Track; + + /** + * Encodes the specified Track message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Track.verify|verify} messages. + * @param message Track message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ITrack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Track message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Track.verify|verify} messages. + * @param message Track message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ITrack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Track message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Track + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.Track; + + /** + * Decodes a Track message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Track + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.Track; + + /** + * Verifies a Track message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Track message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Track + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.Track; + + /** + * Creates a plain object from a Track message. Also converts values to other types if specified. + * @param message Track + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.Track, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Track to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Track + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedAttribute. */ + interface IDetectedAttribute { + + /** DetectedAttribute name */ + name?: (string|null); + + /** DetectedAttribute confidence */ + confidence?: (number|null); + + /** DetectedAttribute value */ + value?: (string|null); + } + + /** Represents a DetectedAttribute. */ + class DetectedAttribute implements IDetectedAttribute { + + /** + * Constructs a new DetectedAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IDetectedAttribute); + + /** DetectedAttribute name. */ + public name: string; + + /** DetectedAttribute confidence. */ + public confidence: number; + + /** DetectedAttribute value. */ + public value: string; + + /** + * Creates a new DetectedAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedAttribute instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IDetectedAttribute): google.cloud.videointelligence.v1p3beta1.DetectedAttribute; + + /** + * Encodes the specified DetectedAttribute message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedAttribute.verify|verify} messages. + * @param message DetectedAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IDetectedAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedAttribute message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedAttribute.verify|verify} messages. + * @param message DetectedAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IDetectedAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedAttribute + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.DetectedAttribute; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedAttribute + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.DetectedAttribute; + + /** + * Verifies a DetectedAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.DetectedAttribute; + + /** + * Creates a plain object from a DetectedAttribute message. Also converts values to other types if specified. + * @param message DetectedAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.DetectedAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Celebrity. */ + interface ICelebrity { + + /** Celebrity name */ + name?: (string|null); + + /** Celebrity displayName */ + displayName?: (string|null); + + /** Celebrity description */ + description?: (string|null); + } + + /** Represents a Celebrity. */ + class Celebrity implements ICelebrity { + + /** + * Constructs a new Celebrity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ICelebrity); + + /** Celebrity name. */ + public name: string; + + /** Celebrity displayName. */ + public displayName: string; + + /** Celebrity description. */ + public description: string; + + /** + * Creates a new Celebrity instance using the specified properties. + * @param [properties] Properties to set + * @returns Celebrity instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ICelebrity): google.cloud.videointelligence.v1p3beta1.Celebrity; + + /** + * Encodes the specified Celebrity message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Celebrity.verify|verify} messages. + * @param message Celebrity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ICelebrity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Celebrity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Celebrity.verify|verify} messages. + * @param message Celebrity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ICelebrity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Celebrity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Celebrity + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.Celebrity; + + /** + * Decodes a Celebrity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Celebrity + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.Celebrity; + + /** + * Verifies a Celebrity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Celebrity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Celebrity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.Celebrity; + + /** + * Creates a plain object from a Celebrity message. Also converts values to other types if specified. + * @param message Celebrity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.Celebrity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Celebrity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Celebrity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CelebrityTrack. */ + interface ICelebrityTrack { + + /** CelebrityTrack celebrities */ + celebrities?: (google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity[]|null); + + /** CelebrityTrack faceTrack */ + faceTrack?: (google.cloud.videointelligence.v1p3beta1.ITrack|null); + } + + /** Represents a CelebrityTrack. */ + class CelebrityTrack implements ICelebrityTrack { + + /** + * Constructs a new CelebrityTrack. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ICelebrityTrack); + + /** CelebrityTrack celebrities. */ + public celebrities: google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity[]; + + /** CelebrityTrack faceTrack. */ + public faceTrack?: (google.cloud.videointelligence.v1p3beta1.ITrack|null); + + /** + * Creates a new CelebrityTrack instance using the specified properties. + * @param [properties] Properties to set + * @returns CelebrityTrack instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ICelebrityTrack): google.cloud.videointelligence.v1p3beta1.CelebrityTrack; + + /** + * Encodes the specified CelebrityTrack message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.verify|verify} messages. + * @param message CelebrityTrack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ICelebrityTrack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CelebrityTrack message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.verify|verify} messages. + * @param message CelebrityTrack message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ICelebrityTrack, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CelebrityTrack message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CelebrityTrack + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.CelebrityTrack; + + /** + * Decodes a CelebrityTrack message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CelebrityTrack + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.CelebrityTrack; + + /** + * Verifies a CelebrityTrack message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CelebrityTrack message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CelebrityTrack + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.CelebrityTrack; + + /** + * Creates a plain object from a CelebrityTrack message. Also converts values to other types if specified. + * @param message CelebrityTrack + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.CelebrityTrack, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CelebrityTrack to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CelebrityTrack + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CelebrityTrack { + + /** Properties of a RecognizedCelebrity. */ + interface IRecognizedCelebrity { + + /** RecognizedCelebrity celebrity */ + celebrity?: (google.cloud.videointelligence.v1p3beta1.ICelebrity|null); + + /** RecognizedCelebrity confidence */ + confidence?: (number|null); + } + + /** Represents a RecognizedCelebrity. */ + class RecognizedCelebrity implements IRecognizedCelebrity { + + /** + * Constructs a new RecognizedCelebrity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity); + + /** RecognizedCelebrity celebrity. */ + public celebrity?: (google.cloud.videointelligence.v1p3beta1.ICelebrity|null); + + /** RecognizedCelebrity confidence. */ + public confidence: number; + + /** + * Creates a new RecognizedCelebrity instance using the specified properties. + * @param [properties] Properties to set + * @returns RecognizedCelebrity instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity): google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity; + + /** + * Encodes the specified RecognizedCelebrity message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.verify|verify} messages. + * @param message RecognizedCelebrity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecognizedCelebrity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.verify|verify} messages. + * @param message RecognizedCelebrity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecognizedCelebrity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecognizedCelebrity + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity; + + /** + * Decodes a RecognizedCelebrity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecognizedCelebrity + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity; + + /** + * Verifies a RecognizedCelebrity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecognizedCelebrity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecognizedCelebrity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity; + + /** + * Creates a plain object from a RecognizedCelebrity message. Also converts values to other types if specified. + * @param message RecognizedCelebrity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecognizedCelebrity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecognizedCelebrity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CelebrityRecognitionAnnotation. */ + interface ICelebrityRecognitionAnnotation { + + /** CelebrityRecognitionAnnotation celebrityTracks */ + celebrityTracks?: (google.cloud.videointelligence.v1p3beta1.ICelebrityTrack[]|null); + } + + /** Represents a CelebrityRecognitionAnnotation. */ + class CelebrityRecognitionAnnotation implements ICelebrityRecognitionAnnotation { + + /** + * Constructs a new CelebrityRecognitionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation); + + /** CelebrityRecognitionAnnotation celebrityTracks. */ + public celebrityTracks: google.cloud.videointelligence.v1p3beta1.ICelebrityTrack[]; + + /** + * Creates a new CelebrityRecognitionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns CelebrityRecognitionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation): google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation; + + /** + * Encodes the specified CelebrityRecognitionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.verify|verify} messages. + * @param message CelebrityRecognitionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CelebrityRecognitionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.verify|verify} messages. + * @param message CelebrityRecognitionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CelebrityRecognitionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CelebrityRecognitionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation; + + /** + * Decodes a CelebrityRecognitionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CelebrityRecognitionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation; + + /** + * Verifies a CelebrityRecognitionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CelebrityRecognitionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CelebrityRecognitionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation; + + /** + * Creates a plain object from a CelebrityRecognitionAnnotation message. Also converts values to other types if specified. + * @param message CelebrityRecognitionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CelebrityRecognitionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CelebrityRecognitionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DetectedLandmark. */ + interface IDetectedLandmark { + + /** DetectedLandmark name */ + name?: (string|null); + + /** DetectedLandmark point */ + point?: (google.cloud.videointelligence.v1p3beta1.INormalizedVertex|null); + + /** DetectedLandmark confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedLandmark. */ + class DetectedLandmark implements IDetectedLandmark { + + /** + * Constructs a new DetectedLandmark. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IDetectedLandmark); + + /** DetectedLandmark name. */ + public name: string; + + /** DetectedLandmark point. */ + public point?: (google.cloud.videointelligence.v1p3beta1.INormalizedVertex|null); + + /** DetectedLandmark confidence. */ + public confidence: number; + + /** + * Creates a new DetectedLandmark instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedLandmark instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IDetectedLandmark): google.cloud.videointelligence.v1p3beta1.DetectedLandmark; + + /** + * Encodes the specified DetectedLandmark message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedLandmark.verify|verify} messages. + * @param message DetectedLandmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IDetectedLandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLandmark message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedLandmark.verify|verify} messages. + * @param message DetectedLandmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IDetectedLandmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedLandmark + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.DetectedLandmark; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedLandmark + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.DetectedLandmark; + + /** + * Verifies a DetectedLandmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectedLandmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedLandmark + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.DetectedLandmark; + + /** + * Creates a plain object from a DetectedLandmark message. Also converts values to other types if specified. + * @param message DetectedLandmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.DetectedLandmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedLandmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedLandmark + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaceDetectionAnnotation. */ + interface IFaceDetectionAnnotation { + + /** FaceDetectionAnnotation tracks */ + tracks?: (google.cloud.videointelligence.v1p3beta1.ITrack[]|null); + + /** FaceDetectionAnnotation thumbnail */ + thumbnail?: (Uint8Array|string|null); + } + + /** Represents a FaceDetectionAnnotation. */ + class FaceDetectionAnnotation implements IFaceDetectionAnnotation { + + /** + * Constructs a new FaceDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation); + + /** FaceDetectionAnnotation tracks. */ + public tracks: google.cloud.videointelligence.v1p3beta1.ITrack[]; + + /** FaceDetectionAnnotation thumbnail. */ + public thumbnail: (Uint8Array|string); + + /** + * Creates a new FaceDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns FaceDetectionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation): google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation; + + /** + * Encodes the specified FaceDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.verify|verify} messages. + * @param message FaceDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaceDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.verify|verify} messages. + * @param message FaceDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaceDetectionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.FaceDetectionAnnotation; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaceDetectionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.FaceDetectionAnnotation; + + /** + * Verifies a FaceDetectionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaceDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaceDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation; + + /** + * Creates a plain object from a FaceDetectionAnnotation message. Also converts values to other types if specified. + * @param message FaceDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaceDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaceDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersonDetectionAnnotation. */ + interface IPersonDetectionAnnotation { + + /** PersonDetectionAnnotation tracks */ + tracks?: (google.cloud.videointelligence.v1p3beta1.ITrack[]|null); + } + + /** Represents a PersonDetectionAnnotation. */ + class PersonDetectionAnnotation implements IPersonDetectionAnnotation { + + /** + * Constructs a new PersonDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation); + + /** PersonDetectionAnnotation tracks. */ + public tracks: google.cloud.videointelligence.v1p3beta1.ITrack[]; + + /** + * Creates a new PersonDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonDetectionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation): google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation; + + /** + * Encodes the specified PersonDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.verify|verify} messages. + * @param message PersonDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersonDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.verify|verify} messages. + * @param message PersonDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonDetectionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.PersonDetectionAnnotation; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonDetectionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.PersonDetectionAnnotation; + + /** + * Verifies a PersonDetectionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersonDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation; + + /** + * Creates a plain object from a PersonDetectionAnnotation message. Also converts values to other types if specified. + * @param message PersonDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersonDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersonDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationResults. */ + interface IVideoAnnotationResults { + + /** VideoAnnotationResults inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationResults segment */ + segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** VideoAnnotationResults segmentLabelAnnotations */ + segmentLabelAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults segmentPresenceLabelAnnotations */ + segmentPresenceLabelAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotLabelAnnotations */ + shotLabelAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults shotPresenceLabelAnnotations */ + shotPresenceLabelAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults frameLabelAnnotations */ + frameLabelAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]|null); + + /** VideoAnnotationResults faceDetectionAnnotations */ + faceDetectionAnnotations?: (google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation[]|null); + + /** VideoAnnotationResults shotAnnotations */ + shotAnnotations?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment[]|null); + + /** VideoAnnotationResults explicitAnnotation */ + explicitAnnotation?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults speechTranscriptions */ + speechTranscriptions?: (google.cloud.videointelligence.v1p3beta1.ISpeechTranscription[]|null); + + /** VideoAnnotationResults textAnnotations */ + textAnnotations?: (google.cloud.videointelligence.v1p3beta1.ITextAnnotation[]|null); + + /** VideoAnnotationResults objectAnnotations */ + objectAnnotations?: (google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation[]|null); + + /** VideoAnnotationResults logoRecognitionAnnotations */ + logoRecognitionAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation[]|null); + + /** VideoAnnotationResults personDetectionAnnotations */ + personDetectionAnnotations?: (google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation[]|null); + + /** VideoAnnotationResults celebrityRecognitionAnnotations */ + celebrityRecognitionAnnotations?: (google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation|null); + + /** VideoAnnotationResults error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a VideoAnnotationResults. */ + class VideoAnnotationResults implements IVideoAnnotationResults { + + /** + * Constructs a new VideoAnnotationResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults); + + /** VideoAnnotationResults inputUri. */ + public inputUri: string; + + /** VideoAnnotationResults segment. */ + public segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** VideoAnnotationResults segmentLabelAnnotations. */ + public segmentLabelAnnotations: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults segmentPresenceLabelAnnotations. */ + public segmentPresenceLabelAnnotations: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotLabelAnnotations. */ + public shotLabelAnnotations: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults shotPresenceLabelAnnotations. */ + public shotPresenceLabelAnnotations: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults frameLabelAnnotations. */ + public frameLabelAnnotations: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]; + + /** VideoAnnotationResults faceDetectionAnnotations. */ + public faceDetectionAnnotations: google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation[]; + + /** VideoAnnotationResults shotAnnotations. */ + public shotAnnotations: google.cloud.videointelligence.v1p3beta1.IVideoSegment[]; + + /** VideoAnnotationResults explicitAnnotation. */ + public explicitAnnotation?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null); + + /** VideoAnnotationResults speechTranscriptions. */ + public speechTranscriptions: google.cloud.videointelligence.v1p3beta1.ISpeechTranscription[]; + + /** VideoAnnotationResults textAnnotations. */ + public textAnnotations: google.cloud.videointelligence.v1p3beta1.ITextAnnotation[]; + + /** VideoAnnotationResults objectAnnotations. */ + public objectAnnotations: google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation[]; + + /** VideoAnnotationResults logoRecognitionAnnotations. */ + public logoRecognitionAnnotations: google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation[]; + + /** VideoAnnotationResults personDetectionAnnotations. */ + public personDetectionAnnotations: google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation[]; + + /** VideoAnnotationResults celebrityRecognitionAnnotations. */ + public celebrityRecognitionAnnotations?: (google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation|null); + + /** VideoAnnotationResults error. */ + public error?: (google.rpc.IStatus|null); + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationResults instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults): google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.verify|verify} messages. + * @param message VideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationResults + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.VideoAnnotationResults; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationResults + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.VideoAnnotationResults; + + /** + * Verifies a VideoAnnotationResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @param message VideoAnnotationResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoResponse. */ + interface IAnnotateVideoResponse { + + /** AnnotateVideoResponse annotationResults */ + annotationResults?: (google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults[]|null); + } + + /** Represents an AnnotateVideoResponse. */ + class AnnotateVideoResponse implements IAnnotateVideoResponse { + + /** + * Constructs a new AnnotateVideoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse); + + /** AnnotateVideoResponse annotationResults. */ + public annotationResults: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults[]; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoResponse instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse): google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.verify|verify} messages. + * @param message AnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoResponse + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.AnnotateVideoResponse; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoResponse + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.AnnotateVideoResponse; + + /** + * Verifies an AnnotateVideoResponse message. + * @param message Plain 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 AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @param message AnnotateVideoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoAnnotationProgress. */ + interface IVideoAnnotationProgress { + + /** VideoAnnotationProgress inputUri */ + inputUri?: (string|null); + + /** VideoAnnotationProgress progressPercent */ + progressPercent?: (number|null); + + /** VideoAnnotationProgress startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress feature */ + feature?: (google.cloud.videointelligence.v1p3beta1.Feature|keyof typeof google.cloud.videointelligence.v1p3beta1.Feature|null); + + /** VideoAnnotationProgress segment */ + segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + } + + /** Represents a VideoAnnotationProgress. */ + class VideoAnnotationProgress implements IVideoAnnotationProgress { + + /** + * Constructs a new VideoAnnotationProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress); + + /** VideoAnnotationProgress inputUri. */ + public inputUri: string; + + /** VideoAnnotationProgress progressPercent. */ + public progressPercent: number; + + /** VideoAnnotationProgress startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VideoAnnotationProgress feature. */ + public feature: (google.cloud.videointelligence.v1p3beta1.Feature|keyof typeof google.cloud.videointelligence.v1p3beta1.Feature); + + /** VideoAnnotationProgress segment. */ + public segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoAnnotationProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress): google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.verify|verify} messages. + * @param message VideoAnnotationProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoAnnotationProgress + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.VideoAnnotationProgress; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoAnnotationProgress + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.VideoAnnotationProgress; + + /** + * Verifies a VideoAnnotationProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoAnnotationProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @param message VideoAnnotationProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotateVideoProgress. */ + interface IAnnotateVideoProgress { + + /** AnnotateVideoProgress annotationProgress */ + annotationProgress?: (google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress[]|null); + } + + /** Represents an AnnotateVideoProgress. */ + class AnnotateVideoProgress implements IAnnotateVideoProgress { + + /** + * Constructs a new AnnotateVideoProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress); + + /** AnnotateVideoProgress annotationProgress. */ + public annotationProgress: google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress[]; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotateVideoProgress instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress): google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.verify|verify} messages. + * @param message AnnotateVideoProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotateVideoProgress + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.AnnotateVideoProgress; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotateVideoProgress + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.AnnotateVideoProgress; + + /** + * Verifies an AnnotateVideoProgress message. + * @param message Plain 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 AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotateVideoProgress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @param message AnnotateVideoProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechTranscriptionConfig. */ + interface ISpeechTranscriptionConfig { + + /** SpeechTranscriptionConfig languageCode */ + languageCode?: (string|null); + + /** SpeechTranscriptionConfig maxAlternatives */ + maxAlternatives?: (number|null); + + /** SpeechTranscriptionConfig filterProfanity */ + filterProfanity?: (boolean|null); + + /** SpeechTranscriptionConfig speechContexts */ + speechContexts?: (google.cloud.videointelligence.v1p3beta1.ISpeechContext[]|null); + + /** SpeechTranscriptionConfig enableAutomaticPunctuation */ + enableAutomaticPunctuation?: (boolean|null); + + /** SpeechTranscriptionConfig audioTracks */ + audioTracks?: (number[]|null); + + /** SpeechTranscriptionConfig enableSpeakerDiarization */ + enableSpeakerDiarization?: (boolean|null); + + /** SpeechTranscriptionConfig diarizationSpeakerCount */ + diarizationSpeakerCount?: (number|null); + + /** SpeechTranscriptionConfig enableWordConfidence */ + enableWordConfidence?: (boolean|null); + } + + /** Represents a SpeechTranscriptionConfig. */ + class SpeechTranscriptionConfig implements ISpeechTranscriptionConfig { + + /** + * Constructs a new SpeechTranscriptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig); + + /** SpeechTranscriptionConfig languageCode. */ + public languageCode: string; + + /** SpeechTranscriptionConfig maxAlternatives. */ + public maxAlternatives: number; + + /** SpeechTranscriptionConfig filterProfanity. */ + public filterProfanity: boolean; + + /** SpeechTranscriptionConfig speechContexts. */ + public speechContexts: google.cloud.videointelligence.v1p3beta1.ISpeechContext[]; + + /** SpeechTranscriptionConfig enableAutomaticPunctuation. */ + public enableAutomaticPunctuation: boolean; + + /** SpeechTranscriptionConfig audioTracks. */ + public audioTracks: number[]; + + /** SpeechTranscriptionConfig enableSpeakerDiarization. */ + public enableSpeakerDiarization: boolean; + + /** SpeechTranscriptionConfig diarizationSpeakerCount. */ + public diarizationSpeakerCount: number; + + /** SpeechTranscriptionConfig enableWordConfidence. */ + public enableWordConfidence: boolean; + + /** + * Creates a new SpeechTranscriptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechTranscriptionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig): google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig; + + /** + * Encodes the specified SpeechTranscriptionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @param message SpeechTranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechTranscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @param message SpeechTranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechTranscriptionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.SpeechTranscriptionConfig; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechTranscriptionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.SpeechTranscriptionConfig; + + /** + * Verifies a SpeechTranscriptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechTranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechTranscriptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig; + + /** + * Creates a plain object from a SpeechTranscriptionConfig message. Also converts values to other types if specified. + * @param message SpeechTranscriptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechTranscriptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechTranscriptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechContext): google.cloud.videointelligence.v1p3beta1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechTranscription. */ + interface ISpeechTranscription { + + /** SpeechTranscription alternatives */ + alternatives?: (google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative[]|null); + + /** SpeechTranscription languageCode */ + languageCode?: (string|null); + } + + /** Represents a SpeechTranscription. */ + class SpeechTranscription implements ISpeechTranscription { + + /** + * Constructs a new SpeechTranscription. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechTranscription); + + /** SpeechTranscription alternatives. */ + public alternatives: google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative[]; + + /** SpeechTranscription languageCode. */ + public languageCode: string; + + /** + * Creates a new SpeechTranscription instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechTranscription instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechTranscription): google.cloud.videointelligence.v1p3beta1.SpeechTranscription; + + /** + * Encodes the specified SpeechTranscription message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscription.verify|verify} messages. + * @param message SpeechTranscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ISpeechTranscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechTranscription message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscription.verify|verify} messages. + * @param message SpeechTranscription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ISpeechTranscription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechTranscription + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.SpeechTranscription; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechTranscription + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.SpeechTranscription; + + /** + * Verifies a SpeechTranscription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechTranscription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechTranscription + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.SpeechTranscription; + + /** + * Creates a plain object from a SpeechTranscription message. Also converts values to other types if specified. + * @param message SpeechTranscription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.SpeechTranscription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechTranscription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechTranscription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechRecognitionAlternative. */ + interface ISpeechRecognitionAlternative { + + /** SpeechRecognitionAlternative transcript */ + transcript?: (string|null); + + /** SpeechRecognitionAlternative confidence */ + confidence?: (number|null); + + /** SpeechRecognitionAlternative words */ + words?: (google.cloud.videointelligence.v1p3beta1.IWordInfo[]|null); + } + + /** Represents a SpeechRecognitionAlternative. */ + class SpeechRecognitionAlternative implements ISpeechRecognitionAlternative { + + /** + * Constructs a new SpeechRecognitionAlternative. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative); + + /** SpeechRecognitionAlternative transcript. */ + public transcript: string; + + /** SpeechRecognitionAlternative confidence. */ + public confidence: number; + + /** SpeechRecognitionAlternative words. */ + public words: google.cloud.videointelligence.v1p3beta1.IWordInfo[]; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechRecognitionAlternative instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative): google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @param message SpeechRecognitionAlternative message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.SpeechRecognitionAlternative; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechRecognitionAlternative + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.SpeechRecognitionAlternative; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechRecognitionAlternative + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @param message SpeechRecognitionAlternative + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WordInfo. */ + interface IWordInfo { + + /** WordInfo startTime */ + startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime */ + endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word */ + word?: (string|null); + + /** WordInfo confidence */ + confidence?: (number|null); + + /** WordInfo speakerTag */ + speakerTag?: (number|null); + } + + /** Represents a WordInfo. */ + class WordInfo implements IWordInfo { + + /** + * Constructs a new WordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IWordInfo); + + /** WordInfo startTime. */ + public startTime?: (google.protobuf.IDuration|null); + + /** WordInfo endTime. */ + public endTime?: (google.protobuf.IDuration|null); + + /** WordInfo word. */ + public word: string; + + /** WordInfo confidence. */ + public confidence: number; + + /** WordInfo speakerTag. */ + public speakerTag: number; + + /** + * Creates a new WordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WordInfo instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IWordInfo): google.cloud.videointelligence.v1p3beta1.WordInfo; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.WordInfo.verify|verify} messages. + * @param message WordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WordInfo + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.WordInfo; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WordInfo + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.WordInfo; + + /** + * Verifies a WordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.WordInfo; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @param message WordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.WordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WordInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.INormalizedVertex): google.cloud.videointelligence.v1p3beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedBoundingPoly. */ + interface INormalizedBoundingPoly { + + /** NormalizedBoundingPoly vertices */ + vertices?: (google.cloud.videointelligence.v1p3beta1.INormalizedVertex[]|null); + } + + /** Represents a NormalizedBoundingPoly. */ + class NormalizedBoundingPoly implements INormalizedBoundingPoly { + + /** + * Constructs a new NormalizedBoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly); + + /** NormalizedBoundingPoly vertices. */ + public vertices: google.cloud.videointelligence.v1p3beta1.INormalizedVertex[]; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedBoundingPoly instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly): google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @param message NormalizedBoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.NormalizedBoundingPoly; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedBoundingPoly + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.NormalizedBoundingPoly; + + /** + * Verifies a NormalizedBoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedBoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @param message NormalizedBoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedBoundingPoly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment segment */ + segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** TextSegment confidence */ + confidence?: (number|null); + + /** TextSegment frames */ + frames?: (google.cloud.videointelligence.v1p3beta1.ITextFrame[]|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ITextSegment); + + /** TextSegment segment. */ + public segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** TextSegment confidence. */ + public confidence: number; + + /** TextSegment frames. */ + public frames: google.cloud.videointelligence.v1p3beta1.ITextFrame[]; + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ITextSegment): google.cloud.videointelligence.v1p3beta1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextFrame. */ + interface ITextFrame { + + /** TextFrame rotatedBoundingBox */ + rotatedBoundingBox?: (google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly|null); + + /** TextFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a TextFrame. */ + class TextFrame implements ITextFrame { + + /** + * Constructs a new TextFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ITextFrame); + + /** TextFrame rotatedBoundingBox. */ + public rotatedBoundingBox?: (google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly|null); + + /** TextFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new TextFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns TextFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ITextFrame): google.cloud.videointelligence.v1p3beta1.TextFrame; + + /** + * Encodes the specified TextFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextFrame.verify|verify} messages. + * @param message TextFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ITextFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextFrame.verify|verify} messages. + * @param message TextFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ITextFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.TextFrame; + + /** + * Decodes a TextFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextFrame + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.TextFrame; + + /** + * Verifies a TextFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.TextFrame; + + /** + * Creates a plain object from a TextFrame message. Also converts values to other types if specified. + * @param message TextFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.TextFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextAnnotation. */ + interface ITextAnnotation { + + /** TextAnnotation text */ + text?: (string|null); + + /** TextAnnotation segments */ + segments?: (google.cloud.videointelligence.v1p3beta1.ITextSegment[]|null); + } + + /** Represents a TextAnnotation. */ + class TextAnnotation implements ITextAnnotation { + + /** + * Constructs a new TextAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ITextAnnotation); + + /** TextAnnotation text. */ + public text: string; + + /** TextAnnotation segments. */ + public segments: google.cloud.videointelligence.v1p3beta1.ITextSegment[]; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ITextAnnotation): google.cloud.videointelligence.v1p3beta1.TextAnnotation; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextAnnotation.verify|verify} messages. + * @param message TextAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ITextAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.TextAnnotation; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.TextAnnotation; + + /** + * Verifies a TextAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.TextAnnotation; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @param message TextAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.TextAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingFrame. */ + interface IObjectTrackingFrame { + + /** ObjectTrackingFrame normalizedBoundingBox */ + normalizedBoundingBox?: (google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null); + + /** ObjectTrackingFrame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents an ObjectTrackingFrame. */ + class ObjectTrackingFrame implements IObjectTrackingFrame { + + /** + * Constructs a new ObjectTrackingFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame); + + /** ObjectTrackingFrame normalizedBoundingBox. */ + public normalizedBoundingBox?: (google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null); + + /** ObjectTrackingFrame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingFrame instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame): google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.verify|verify} messages. + * @param message ObjectTrackingFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.verify|verify} messages. + * @param message ObjectTrackingFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingFrame + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ObjectTrackingFrame; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingFrame + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ObjectTrackingFrame; + + /** + * Verifies an ObjectTrackingFrame message. + * @param message Plain 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 ObjectTrackingFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame; + + /** + * Creates a plain object from an ObjectTrackingFrame message. Also converts values to other types if specified. + * @param message ObjectTrackingFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ObjectTrackingAnnotation. */ + interface IObjectTrackingAnnotation { + + /** ObjectTrackingAnnotation segment */ + segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId */ + trackId?: (number|Long|string|null); + + /** ObjectTrackingAnnotation entity */ + entity?: (google.cloud.videointelligence.v1p3beta1.IEntity|null); + + /** ObjectTrackingAnnotation confidence */ + confidence?: (number|null); + + /** ObjectTrackingAnnotation frames */ + frames?: (google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame[]|null); + } + + /** Represents an ObjectTrackingAnnotation. */ + class ObjectTrackingAnnotation implements IObjectTrackingAnnotation { + + /** + * Constructs a new ObjectTrackingAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation); + + /** ObjectTrackingAnnotation segment. */ + public segment?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment|null); + + /** ObjectTrackingAnnotation trackId. */ + public trackId?: (number|Long|string|null); + + /** ObjectTrackingAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1p3beta1.IEntity|null); + + /** ObjectTrackingAnnotation confidence. */ + public confidence: number; + + /** ObjectTrackingAnnotation frames. */ + public frames: google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame[]; + + /** ObjectTrackingAnnotation trackInfo. */ + public trackInfo?: ("segment"|"trackId"); + + /** + * Creates a new ObjectTrackingAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ObjectTrackingAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation): google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation; + + /** + * Encodes the specified ObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @param message ObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @param message ObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObjectTrackingAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.ObjectTrackingAnnotation; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObjectTrackingAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.ObjectTrackingAnnotation; + + /** + * Verifies an ObjectTrackingAnnotation message. + * @param message Plain 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 ObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObjectTrackingAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation; + + /** + * Creates a plain object from an ObjectTrackingAnnotation message. Also converts values to other types if specified. + * @param message ObjectTrackingAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObjectTrackingAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ObjectTrackingAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogoRecognitionAnnotation. */ + interface ILogoRecognitionAnnotation { + + /** LogoRecognitionAnnotation entity */ + entity?: (google.cloud.videointelligence.v1p3beta1.IEntity|null); + + /** LogoRecognitionAnnotation tracks */ + tracks?: (google.cloud.videointelligence.v1p3beta1.ITrack[]|null); + + /** LogoRecognitionAnnotation segments */ + segments?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment[]|null); + } + + /** Represents a LogoRecognitionAnnotation. */ + class LogoRecognitionAnnotation implements ILogoRecognitionAnnotation { + + /** + * Constructs a new LogoRecognitionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation); + + /** LogoRecognitionAnnotation entity. */ + public entity?: (google.cloud.videointelligence.v1p3beta1.IEntity|null); + + /** LogoRecognitionAnnotation tracks. */ + public tracks: google.cloud.videointelligence.v1p3beta1.ITrack[]; + + /** LogoRecognitionAnnotation segments. */ + public segments: google.cloud.videointelligence.v1p3beta1.IVideoSegment[]; + + /** + * Creates a new LogoRecognitionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns LogoRecognitionAnnotation instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation): google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation; + + /** + * Encodes the specified LogoRecognitionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.verify|verify} messages. + * @param message LogoRecognitionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogoRecognitionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.verify|verify} messages. + * @param message LogoRecognitionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogoRecognitionAnnotation + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.LogoRecognitionAnnotation; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogoRecognitionAnnotation + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.LogoRecognitionAnnotation; + + /** + * Verifies a LogoRecognitionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogoRecognitionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogoRecognitionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation; + + /** + * Creates a plain object from a LogoRecognitionAnnotation message. Also converts values to other types if specified. + * @param message LogoRecognitionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogoRecognitionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogoRecognitionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingAnnotateVideoRequest. */ + interface IStreamingAnnotateVideoRequest { + + /** StreamingAnnotateVideoRequest videoConfig */ + videoConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig|null); + + /** StreamingAnnotateVideoRequest inputContent */ + inputContent?: (Uint8Array|string|null); + } + + /** Represents a StreamingAnnotateVideoRequest. */ + class StreamingAnnotateVideoRequest implements IStreamingAnnotateVideoRequest { + + /** + * Constructs a new StreamingAnnotateVideoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest); + + /** StreamingAnnotateVideoRequest videoConfig. */ + public videoConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig|null); + + /** StreamingAnnotateVideoRequest inputContent. */ + public inputContent?: (Uint8Array|string|null); + + /** StreamingAnnotateVideoRequest streamingRequest. */ + public streamingRequest?: ("videoConfig"|"inputContent"); + + /** + * Creates a new StreamingAnnotateVideoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAnnotateVideoRequest instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest): google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest; + + /** + * Encodes the specified StreamingAnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.verify|verify} messages. + * @param message StreamingAnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.verify|verify} messages. + * @param message StreamingAnnotateVideoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAnnotateVideoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAnnotateVideoRequest + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest; + + /** + * Decodes a StreamingAnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAnnotateVideoRequest + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest; + + /** + * Verifies a StreamingAnnotateVideoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAnnotateVideoRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest; + + /** + * Creates a plain object from a StreamingAnnotateVideoRequest message. Also converts values to other types if specified. + * @param message StreamingAnnotateVideoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAnnotateVideoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingAnnotateVideoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingVideoConfig. */ + interface IStreamingVideoConfig { + + /** StreamingVideoConfig shotChangeDetectionConfig */ + shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig|null); + + /** StreamingVideoConfig labelDetectionConfig */ + labelDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig|null); + + /** StreamingVideoConfig explicitContentDetectionConfig */ + explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig|null); + + /** StreamingVideoConfig objectTrackingConfig */ + objectTrackingConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig|null); + + /** StreamingVideoConfig automlActionRecognitionConfig */ + automlActionRecognitionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig|null); + + /** StreamingVideoConfig automlClassificationConfig */ + automlClassificationConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig|null); + + /** StreamingVideoConfig automlObjectTrackingConfig */ + automlObjectTrackingConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig|null); + + /** StreamingVideoConfig feature */ + feature?: (google.cloud.videointelligence.v1p3beta1.StreamingFeature|keyof typeof google.cloud.videointelligence.v1p3beta1.StreamingFeature|null); + + /** StreamingVideoConfig storageConfig */ + storageConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig|null); + } + + /** Represents a StreamingVideoConfig. */ + class StreamingVideoConfig implements IStreamingVideoConfig { + + /** + * Constructs a new StreamingVideoConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig); + + /** StreamingVideoConfig shotChangeDetectionConfig. */ + public shotChangeDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig|null); + + /** StreamingVideoConfig labelDetectionConfig. */ + public labelDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig|null); + + /** StreamingVideoConfig explicitContentDetectionConfig. */ + public explicitContentDetectionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig|null); + + /** StreamingVideoConfig objectTrackingConfig. */ + public objectTrackingConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig|null); + + /** StreamingVideoConfig automlActionRecognitionConfig. */ + public automlActionRecognitionConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig|null); + + /** StreamingVideoConfig automlClassificationConfig. */ + public automlClassificationConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig|null); + + /** StreamingVideoConfig automlObjectTrackingConfig. */ + public automlObjectTrackingConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig|null); + + /** StreamingVideoConfig feature. */ + public feature: (google.cloud.videointelligence.v1p3beta1.StreamingFeature|keyof typeof google.cloud.videointelligence.v1p3beta1.StreamingFeature); + + /** StreamingVideoConfig storageConfig. */ + public storageConfig?: (google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig|null); + + /** StreamingVideoConfig streamingConfig. */ + public streamingConfig?: ("shotChangeDetectionConfig"|"labelDetectionConfig"|"explicitContentDetectionConfig"|"objectTrackingConfig"|"automlActionRecognitionConfig"|"automlClassificationConfig"|"automlObjectTrackingConfig"); + + /** + * Creates a new StreamingVideoConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingVideoConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig): google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig; + + /** + * Encodes the specified StreamingVideoConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.verify|verify} messages. + * @param message StreamingVideoConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingVideoConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.verify|verify} messages. + * @param message StreamingVideoConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingVideoConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingVideoConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingVideoConfig; + + /** + * Decodes a StreamingVideoConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingVideoConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingVideoConfig; + + /** + * Verifies a StreamingVideoConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingVideoConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingVideoConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig; + + /** + * Creates a plain object from a StreamingVideoConfig message. Also converts values to other types if specified. + * @param message StreamingVideoConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingVideoConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingVideoConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingAnnotateVideoResponse. */ + interface IStreamingAnnotateVideoResponse { + + /** StreamingAnnotateVideoResponse error */ + error?: (google.rpc.IStatus|null); + + /** StreamingAnnotateVideoResponse annotationResults */ + annotationResults?: (google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults|null); + + /** StreamingAnnotateVideoResponse annotationResultsUri */ + annotationResultsUri?: (string|null); + } + + /** Represents a StreamingAnnotateVideoResponse. */ + class StreamingAnnotateVideoResponse implements IStreamingAnnotateVideoResponse { + + /** + * Constructs a new StreamingAnnotateVideoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse); + + /** StreamingAnnotateVideoResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** StreamingAnnotateVideoResponse annotationResults. */ + public annotationResults?: (google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults|null); + + /** StreamingAnnotateVideoResponse annotationResultsUri. */ + public annotationResultsUri: string; + + /** + * Creates a new StreamingAnnotateVideoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAnnotateVideoResponse instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse): google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse; + + /** + * Encodes the specified StreamingAnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.verify|verify} messages. + * @param message StreamingAnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.verify|verify} messages. + * @param message StreamingAnnotateVideoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAnnotateVideoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAnnotateVideoResponse + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse; + + /** + * Decodes a StreamingAnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAnnotateVideoResponse + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse; + + /** + * Verifies a StreamingAnnotateVideoResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAnnotateVideoResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse; + + /** + * Creates a plain object from a StreamingAnnotateVideoResponse message. Also converts values to other types if specified. + * @param message StreamingAnnotateVideoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAnnotateVideoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingAnnotateVideoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingVideoAnnotationResults. */ + interface IStreamingVideoAnnotationResults { + + /** StreamingVideoAnnotationResults shotAnnotations */ + shotAnnotations?: (google.cloud.videointelligence.v1p3beta1.IVideoSegment[]|null); + + /** StreamingVideoAnnotationResults labelAnnotations */ + labelAnnotations?: (google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]|null); + + /** StreamingVideoAnnotationResults explicitAnnotation */ + explicitAnnotation?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null); + + /** StreamingVideoAnnotationResults objectAnnotations */ + objectAnnotations?: (google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation[]|null); + } + + /** Represents a StreamingVideoAnnotationResults. */ + class StreamingVideoAnnotationResults implements IStreamingVideoAnnotationResults { + + /** + * Constructs a new StreamingVideoAnnotationResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults); + + /** StreamingVideoAnnotationResults shotAnnotations. */ + public shotAnnotations: google.cloud.videointelligence.v1p3beta1.IVideoSegment[]; + + /** StreamingVideoAnnotationResults labelAnnotations. */ + public labelAnnotations: google.cloud.videointelligence.v1p3beta1.ILabelAnnotation[]; + + /** StreamingVideoAnnotationResults explicitAnnotation. */ + public explicitAnnotation?: (google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null); + + /** StreamingVideoAnnotationResults objectAnnotations. */ + public objectAnnotations: google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation[]; + + /** + * Creates a new StreamingVideoAnnotationResults instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingVideoAnnotationResults instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults): google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults; + + /** + * Encodes the specified StreamingVideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.verify|verify} messages. + * @param message StreamingVideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingVideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.verify|verify} messages. + * @param message StreamingVideoAnnotationResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingVideoAnnotationResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingVideoAnnotationResults + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingVideoAnnotationResults; + + /** + * Decodes a StreamingVideoAnnotationResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingVideoAnnotationResults + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingVideoAnnotationResults; + + /** + * Verifies a StreamingVideoAnnotationResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingVideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingVideoAnnotationResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults; + + /** + * Creates a plain object from a StreamingVideoAnnotationResults message. Also converts values to other types if specified. + * @param message StreamingVideoAnnotationResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingVideoAnnotationResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingVideoAnnotationResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingShotChangeDetectionConfig. */ + interface IStreamingShotChangeDetectionConfig { + } + + /** Represents a StreamingShotChangeDetectionConfig. */ + class StreamingShotChangeDetectionConfig implements IStreamingShotChangeDetectionConfig { + + /** + * Constructs a new StreamingShotChangeDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig); + + /** + * Creates a new StreamingShotChangeDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingShotChangeDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig): google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig; + + /** + * Encodes the specified StreamingShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.verify|verify} messages. + * @param message StreamingShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.verify|verify} messages. + * @param message StreamingShotChangeDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingShotChangeDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingShotChangeDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig; + + /** + * Decodes a StreamingShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingShotChangeDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig; + + /** + * Verifies a StreamingShotChangeDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingShotChangeDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig; + + /** + * Creates a plain object from a StreamingShotChangeDetectionConfig message. Also converts values to other types if specified. + * @param message StreamingShotChangeDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingShotChangeDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingShotChangeDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingLabelDetectionConfig. */ + interface IStreamingLabelDetectionConfig { + + /** StreamingLabelDetectionConfig stationaryCamera */ + stationaryCamera?: (boolean|null); + } + + /** Represents a StreamingLabelDetectionConfig. */ + class StreamingLabelDetectionConfig implements IStreamingLabelDetectionConfig { + + /** + * Constructs a new StreamingLabelDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig); + + /** StreamingLabelDetectionConfig stationaryCamera. */ + public stationaryCamera: boolean; + + /** + * Creates a new StreamingLabelDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingLabelDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig): google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig; + + /** + * Encodes the specified StreamingLabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.verify|verify} messages. + * @param message StreamingLabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingLabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.verify|verify} messages. + * @param message StreamingLabelDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingLabelDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingLabelDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingLabelDetectionConfig; + + /** + * Decodes a StreamingLabelDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingLabelDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingLabelDetectionConfig; + + /** + * Verifies a StreamingLabelDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingLabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingLabelDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig; + + /** + * Creates a plain object from a StreamingLabelDetectionConfig message. Also converts values to other types if specified. + * @param message StreamingLabelDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingLabelDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingLabelDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingExplicitContentDetectionConfig. */ + interface IStreamingExplicitContentDetectionConfig { + } + + /** Represents a StreamingExplicitContentDetectionConfig. */ + class StreamingExplicitContentDetectionConfig implements IStreamingExplicitContentDetectionConfig { + + /** + * Constructs a new StreamingExplicitContentDetectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig); + + /** + * Creates a new StreamingExplicitContentDetectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingExplicitContentDetectionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig): google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig; + + /** + * Encodes the specified StreamingExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.verify|verify} messages. + * @param message StreamingExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.verify|verify} messages. + * @param message StreamingExplicitContentDetectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingExplicitContentDetectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingExplicitContentDetectionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig; + + /** + * Decodes a StreamingExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingExplicitContentDetectionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig; + + /** + * Verifies a StreamingExplicitContentDetectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingExplicitContentDetectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig; + + /** + * Creates a plain object from a StreamingExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @param message StreamingExplicitContentDetectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingExplicitContentDetectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingExplicitContentDetectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingObjectTrackingConfig. */ + interface IStreamingObjectTrackingConfig { + } + + /** Represents a StreamingObjectTrackingConfig. */ + class StreamingObjectTrackingConfig implements IStreamingObjectTrackingConfig { + + /** + * Constructs a new StreamingObjectTrackingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig); + + /** + * Creates a new StreamingObjectTrackingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingObjectTrackingConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig): google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig; + + /** + * Encodes the specified StreamingObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.verify|verify} messages. + * @param message StreamingObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.verify|verify} messages. + * @param message StreamingObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingObjectTrackingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingObjectTrackingConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingObjectTrackingConfig; + + /** + * Decodes a StreamingObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingObjectTrackingConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingObjectTrackingConfig; + + /** + * Verifies a StreamingObjectTrackingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingObjectTrackingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig; + + /** + * Creates a plain object from a StreamingObjectTrackingConfig message. Also converts values to other types if specified. + * @param message StreamingObjectTrackingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingObjectTrackingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingObjectTrackingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingAutomlActionRecognitionConfig. */ + interface IStreamingAutomlActionRecognitionConfig { + + /** StreamingAutomlActionRecognitionConfig modelName */ + modelName?: (string|null); + } + + /** Represents a StreamingAutomlActionRecognitionConfig. */ + class StreamingAutomlActionRecognitionConfig implements IStreamingAutomlActionRecognitionConfig { + + /** + * Constructs a new StreamingAutomlActionRecognitionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig); + + /** StreamingAutomlActionRecognitionConfig modelName. */ + public modelName: string; + + /** + * Creates a new StreamingAutomlActionRecognitionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAutomlActionRecognitionConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig): google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig; + + /** + * Encodes the specified StreamingAutomlActionRecognitionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.verify|verify} messages. + * @param message StreamingAutomlActionRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAutomlActionRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.verify|verify} messages. + * @param message StreamingAutomlActionRecognitionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAutomlActionRecognitionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAutomlActionRecognitionConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig; + + /** + * Decodes a StreamingAutomlActionRecognitionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAutomlActionRecognitionConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig; + + /** + * Verifies a StreamingAutomlActionRecognitionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAutomlActionRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAutomlActionRecognitionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig; + + /** + * Creates a plain object from a StreamingAutomlActionRecognitionConfig message. Also converts values to other types if specified. + * @param message StreamingAutomlActionRecognitionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAutomlActionRecognitionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingAutomlActionRecognitionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingAutomlClassificationConfig. */ + interface IStreamingAutomlClassificationConfig { + + /** StreamingAutomlClassificationConfig modelName */ + modelName?: (string|null); + } + + /** Represents a StreamingAutomlClassificationConfig. */ + class StreamingAutomlClassificationConfig implements IStreamingAutomlClassificationConfig { + + /** + * Constructs a new StreamingAutomlClassificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig); + + /** StreamingAutomlClassificationConfig modelName. */ + public modelName: string; + + /** + * Creates a new StreamingAutomlClassificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAutomlClassificationConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig): google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig; + + /** + * Encodes the specified StreamingAutomlClassificationConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.verify|verify} messages. + * @param message StreamingAutomlClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAutomlClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.verify|verify} messages. + * @param message StreamingAutomlClassificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAutomlClassificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAutomlClassificationConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig; + + /** + * Decodes a StreamingAutomlClassificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAutomlClassificationConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig; + + /** + * Verifies a StreamingAutomlClassificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAutomlClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAutomlClassificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig; + + /** + * Creates a plain object from a StreamingAutomlClassificationConfig message. Also converts values to other types if specified. + * @param message StreamingAutomlClassificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAutomlClassificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingAutomlClassificationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingAutomlObjectTrackingConfig. */ + interface IStreamingAutomlObjectTrackingConfig { + + /** StreamingAutomlObjectTrackingConfig modelName */ + modelName?: (string|null); + } + + /** Represents a StreamingAutomlObjectTrackingConfig. */ + class StreamingAutomlObjectTrackingConfig implements IStreamingAutomlObjectTrackingConfig { + + /** + * Constructs a new StreamingAutomlObjectTrackingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig); + + /** StreamingAutomlObjectTrackingConfig modelName. */ + public modelName: string; + + /** + * Creates a new StreamingAutomlObjectTrackingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAutomlObjectTrackingConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig): google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig; + + /** + * Encodes the specified StreamingAutomlObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.verify|verify} messages. + * @param message StreamingAutomlObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAutomlObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.verify|verify} messages. + * @param message StreamingAutomlObjectTrackingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAutomlObjectTrackingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAutomlObjectTrackingConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig; + + /** + * Decodes a StreamingAutomlObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAutomlObjectTrackingConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig; + + /** + * Verifies a StreamingAutomlObjectTrackingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAutomlObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAutomlObjectTrackingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig; + + /** + * Creates a plain object from a StreamingAutomlObjectTrackingConfig message. Also converts values to other types if specified. + * @param message StreamingAutomlObjectTrackingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAutomlObjectTrackingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingAutomlObjectTrackingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingStorageConfig. */ + interface IStreamingStorageConfig { + + /** StreamingStorageConfig enableStorageAnnotationResult */ + enableStorageAnnotationResult?: (boolean|null); + + /** StreamingStorageConfig annotationResultStorageDirectory */ + annotationResultStorageDirectory?: (string|null); + } + + /** Represents a StreamingStorageConfig. */ + class StreamingStorageConfig implements IStreamingStorageConfig { + + /** + * Constructs a new StreamingStorageConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig); + + /** StreamingStorageConfig enableStorageAnnotationResult. */ + public enableStorageAnnotationResult: boolean; + + /** StreamingStorageConfig annotationResultStorageDirectory. */ + public annotationResultStorageDirectory: string; + + /** + * Creates a new StreamingStorageConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingStorageConfig instance + */ + public static create(properties?: google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig): google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig; + + /** + * Encodes the specified StreamingStorageConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.verify|verify} messages. + * @param message StreamingStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingStorageConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.verify|verify} messages. + * @param message StreamingStorageConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingStorageConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingStorageConfig + * @throws {Error} If the payload is not 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.videointelligence.v1p3beta1.StreamingStorageConfig; + + /** + * Decodes a StreamingStorageConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingStorageConfig + * @throws {Error} If the payload 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.videointelligence.v1p3beta1.StreamingStorageConfig; + + /** + * Verifies a StreamingStorageConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingStorageConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingStorageConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig; + + /** + * Creates a plain object from a StreamingStorageConfig message. Also converts values to other types if specified. + * @param message StreamingStorageConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingStorageConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingStorageConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-videointelligence/protos/protos.js b/packages/google-cloud-videointelligence/protos/protos.js new file mode 100644 index 00000000000..ca5a8c5a2bb --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/protos.js @@ -0,0 +1,60616 @@ +// 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_intelligence_protos || ($protobuf.roots._google_cloud_video_intelligence_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.videointelligence = (function() { + + /** + * Namespace videointelligence. + * @memberof google.cloud + * @namespace + */ + var videointelligence = {}; + + videointelligence.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.videointelligence + * @namespace + */ + var v1 = {}; + + v1.VideoIntelligenceService = (function() { + + /** + * Constructs a new VideoIntelligenceService service. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a VideoIntelligenceService + * @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 VideoIntelligenceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VideoIntelligenceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoIntelligenceService; + + /** + * Creates new VideoIntelligenceService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.videointelligence.v1.VideoIntelligenceService + * @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 {VideoIntelligenceService} RPC service. Useful where requests and/or responses are streamed. + */ + VideoIntelligenceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.videointelligence.v1.VideoIntelligenceService|annotateVideo}. + * @memberof google.cloud.videointelligence.v1.VideoIntelligenceService + * @typedef AnnotateVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @param {google.cloud.videointelligence.v1.VideoIntelligenceService.AnnotateVideoCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoIntelligenceService.prototype.annotateVideo = function annotateVideo(request, callback) { + return this.rpcCall(annotateVideo, $root.google.cloud.videointelligence.v1.AnnotateVideoRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnnotateVideo" }); + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VideoIntelligenceService; + })(); + + v1.AnnotateVideoRequest = (function() { + + /** + * Properties of an AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1 + * @interface IAnnotateVideoRequest + * @property {string|null} [inputUri] AnnotateVideoRequest inputUri + * @property {Uint8Array|null} [inputContent] AnnotateVideoRequest inputContent + * @property {Array.|null} [features] AnnotateVideoRequest features + * @property {google.cloud.videointelligence.v1.IVideoContext|null} [videoContext] AnnotateVideoRequest videoContext + * @property {string|null} [outputUri] AnnotateVideoRequest outputUri + * @property {string|null} [locationId] AnnotateVideoRequest locationId + */ + + /** + * Constructs a new AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an AnnotateVideoRequest. + * @implements IAnnotateVideoRequest + * @constructor + * @param {google.cloud.videointelligence.v1.IAnnotateVideoRequest=} [properties] Properties to set + */ + function AnnotateVideoRequest(properties) { + this.features = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoRequest inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputUri = ""; + + /** + * AnnotateVideoRequest inputContent. + * @member {Uint8Array} inputContent + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputContent = $util.newBuffer([]); + + /** + * AnnotateVideoRequest features. + * @member {Array.} features + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateVideoRequest videoContext. + * @member {google.cloud.videointelligence.v1.IVideoContext|null|undefined} videoContext + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.videoContext = null; + + /** + * AnnotateVideoRequest outputUri. + * @member {string} outputUri + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.outputUri = ""; + + /** + * AnnotateVideoRequest locationId. + * @member {string} locationId + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.locationId = ""; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoRequest=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.AnnotateVideoRequest} AnnotateVideoRequest instance + */ + AnnotateVideoRequest.create = function create(properties) { + return new AnnotateVideoRequest(properties); + }; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.features != null && message.features.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.features.length; ++i) + writer.int32(message.features[i]); + writer.ldelim(); + } + if (message.videoContext != null && Object.hasOwnProperty.call(message, "videoContext")) + $root.google.cloud.videointelligence.v1.VideoContext.encode(message.videoContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUri); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + if (message.inputContent != null && Object.hasOwnProperty.call(message, "inputContent")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputContent); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decode = function 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.videointelligence.v1.AnnotateVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 6: { + message.inputContent = reader.bytes(); + break; + } + case 2: { + if (!(message.features && message.features.length)) + message.features = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.features.push(reader.int32()); + } else + message.features.push(reader.int32()); + break; + } + case 3: { + message.videoContext = $root.google.cloud.videointelligence.v1.VideoContext.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputUri = reader.string(); + break; + } + case 5: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoRequest message. + * @function verify + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + if (!(message.inputContent && typeof message.inputContent.length === "number" || $util.isString(message.inputContent))) + return "inputContent: buffer expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + switch (message.features[i]) { + default: + return "features: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 9: + case 12: + case 14: + break; + } + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) { + var error = $root.google.cloud.videointelligence.v1.VideoContext.verify(message.videoContext); + if (error) + return "videoContext." + error; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates an AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.AnnotateVideoRequest} AnnotateVideoRequest + */ + AnnotateVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.AnnotateVideoRequest) + return object; + var message = new $root.google.cloud.videointelligence.v1.AnnotateVideoRequest(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.inputContent != null) + if (typeof object.inputContent === "string") + $util.base64.decode(object.inputContent, message.inputContent = $util.newBuffer($util.base64.length(object.inputContent)), 0); + else if (object.inputContent.length >= 0) + message.inputContent = object.inputContent; + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.videointelligence.v1.AnnotateVideoRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + switch (object.features[i]) { + default: + if (typeof object.features[i] === "number") { + message.features[i] = object.features[i]; + break; + } + case "FEATURE_UNSPECIFIED": + case 0: + message.features[i] = 0; + break; + case "LABEL_DETECTION": + case 1: + message.features[i] = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.features[i] = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.features[i] = 3; + break; + case "FACE_DETECTION": + case 4: + message.features[i] = 4; + break; + case "SPEECH_TRANSCRIPTION": + case 6: + message.features[i] = 6; + break; + case "TEXT_DETECTION": + case 7: + message.features[i] = 7; + break; + case "OBJECT_TRACKING": + case 9: + message.features[i] = 9; + break; + case "LOGO_RECOGNITION": + case 12: + message.features[i] = 12; + break; + case "PERSON_DETECTION": + case 14: + message.features[i] = 14; + break; + } + } + if (object.videoContext != null) { + if (typeof object.videoContext !== "object") + throw TypeError(".google.cloud.videointelligence.v1.AnnotateVideoRequest.videoContext: object expected"); + message.videoContext = $root.google.cloud.videointelligence.v1.VideoContext.fromObject(object.videoContext); + } + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1.AnnotateVideoRequest} message AnnotateVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputUri = ""; + object.videoContext = null; + object.outputUri = ""; + object.locationId = ""; + if (options.bytes === String) + object.inputContent = ""; + else { + object.inputContent = []; + if (options.bytes !== Array) + object.inputContent = $util.newBuffer(object.inputContent); + } + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = options.enums === String ? $root.google.cloud.videointelligence.v1.Feature[message.features[j]] === undefined ? message.features[j] : $root.google.cloud.videointelligence.v1.Feature[message.features[j]] : message.features[j]; + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) + object.videoContext = $root.google.cloud.videointelligence.v1.VideoContext.toObject(message.videoContext, options); + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + object.inputContent = options.bytes === String ? $util.base64.encode(message.inputContent, 0, message.inputContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputContent) : message.inputContent; + return object; + }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.AnnotateVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.AnnotateVideoRequest"; + }; + + return AnnotateVideoRequest; + })(); + + v1.VideoContext = (function() { + + /** + * Properties of a VideoContext. + * @memberof google.cloud.videointelligence.v1 + * @interface IVideoContext + * @property {Array.|null} [segments] VideoContext segments + * @property {google.cloud.videointelligence.v1.ILabelDetectionConfig|null} [labelDetectionConfig] VideoContext labelDetectionConfig + * @property {google.cloud.videointelligence.v1.IShotChangeDetectionConfig|null} [shotChangeDetectionConfig] VideoContext shotChangeDetectionConfig + * @property {google.cloud.videointelligence.v1.IExplicitContentDetectionConfig|null} [explicitContentDetectionConfig] VideoContext explicitContentDetectionConfig + * @property {google.cloud.videointelligence.v1.IFaceDetectionConfig|null} [faceDetectionConfig] VideoContext faceDetectionConfig + * @property {google.cloud.videointelligence.v1.ISpeechTranscriptionConfig|null} [speechTranscriptionConfig] VideoContext speechTranscriptionConfig + * @property {google.cloud.videointelligence.v1.ITextDetectionConfig|null} [textDetectionConfig] VideoContext textDetectionConfig + * @property {google.cloud.videointelligence.v1.IPersonDetectionConfig|null} [personDetectionConfig] VideoContext personDetectionConfig + * @property {google.cloud.videointelligence.v1.IObjectTrackingConfig|null} [objectTrackingConfig] VideoContext objectTrackingConfig + */ + + /** + * Constructs a new VideoContext. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a VideoContext. + * @implements IVideoContext + * @constructor + * @param {google.cloud.videointelligence.v1.IVideoContext=} [properties] Properties to set + */ + function VideoContext(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoContext segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.segments = $util.emptyArray; + + /** + * VideoContext labelDetectionConfig. + * @member {google.cloud.videointelligence.v1.ILabelDetectionConfig|null|undefined} labelDetectionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.labelDetectionConfig = null; + + /** + * VideoContext shotChangeDetectionConfig. + * @member {google.cloud.videointelligence.v1.IShotChangeDetectionConfig|null|undefined} shotChangeDetectionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.shotChangeDetectionConfig = null; + + /** + * VideoContext explicitContentDetectionConfig. + * @member {google.cloud.videointelligence.v1.IExplicitContentDetectionConfig|null|undefined} explicitContentDetectionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.explicitContentDetectionConfig = null; + + /** + * VideoContext faceDetectionConfig. + * @member {google.cloud.videointelligence.v1.IFaceDetectionConfig|null|undefined} faceDetectionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.faceDetectionConfig = null; + + /** + * VideoContext speechTranscriptionConfig. + * @member {google.cloud.videointelligence.v1.ISpeechTranscriptionConfig|null|undefined} speechTranscriptionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.speechTranscriptionConfig = null; + + /** + * VideoContext textDetectionConfig. + * @member {google.cloud.videointelligence.v1.ITextDetectionConfig|null|undefined} textDetectionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.textDetectionConfig = null; + + /** + * VideoContext personDetectionConfig. + * @member {google.cloud.videointelligence.v1.IPersonDetectionConfig|null|undefined} personDetectionConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.personDetectionConfig = null; + + /** + * VideoContext objectTrackingConfig. + * @member {google.cloud.videointelligence.v1.IObjectTrackingConfig|null|undefined} objectTrackingConfig + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + */ + VideoContext.prototype.objectTrackingConfig = null; + + /** + * Creates a new VideoContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1.IVideoContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.VideoContext} VideoContext instance + */ + VideoContext.create = function create(properties) { + return new VideoContext(properties); + }; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labelDetectionConfig != null && Object.hasOwnProperty.call(message, "labelDetectionConfig")) + $root.google.cloud.videointelligence.v1.LabelDetectionConfig.encode(message.labelDetectionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotChangeDetectionConfig != null && Object.hasOwnProperty.call(message, "shotChangeDetectionConfig")) + $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig.encode(message.shotChangeDetectionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explicitContentDetectionConfig != null && Object.hasOwnProperty.call(message, "explicitContentDetectionConfig")) + $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.encode(message.explicitContentDetectionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.faceDetectionConfig != null && Object.hasOwnProperty.call(message, "faceDetectionConfig")) + $root.google.cloud.videointelligence.v1.FaceDetectionConfig.encode(message.faceDetectionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.speechTranscriptionConfig != null && Object.hasOwnProperty.call(message, "speechTranscriptionConfig")) + $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig.encode(message.speechTranscriptionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textDetectionConfig != null && Object.hasOwnProperty.call(message, "textDetectionConfig")) + $root.google.cloud.videointelligence.v1.TextDetectionConfig.encode(message.textDetectionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.personDetectionConfig != null && Object.hasOwnProperty.call(message, "personDetectionConfig")) + $root.google.cloud.videointelligence.v1.PersonDetectionConfig.encode(message.personDetectionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.objectTrackingConfig != null && Object.hasOwnProperty.call(message, "objectTrackingConfig")) + $root.google.cloud.videointelligence.v1.ObjectTrackingConfig.encode(message.objectTrackingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decode = function 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.videointelligence.v1.VideoContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1.LabelDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.faceDetectionConfig = $root.google.cloud.videointelligence.v1.FaceDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.textDetectionConfig = $root.google.cloud.videointelligence.v1.TextDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.personDetectionConfig = $root.google.cloud.videointelligence.v1.PersonDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.objectTrackingConfig = $root.google.cloud.videointelligence.v1.ObjectTrackingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1.LabelDetectionConfig.verify(message.labelDetectionConfig); + if (error) + return "labelDetectionConfig." + error; + } + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig.verify(message.shotChangeDetectionConfig); + if (error) + return "shotChangeDetectionConfig." + error; + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.verify(message.explicitContentDetectionConfig); + if (error) + return "explicitContentDetectionConfig." + error; + } + if (message.faceDetectionConfig != null && message.hasOwnProperty("faceDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1.FaceDetectionConfig.verify(message.faceDetectionConfig); + if (error) + return "faceDetectionConfig." + error; + } + if (message.speechTranscriptionConfig != null && message.hasOwnProperty("speechTranscriptionConfig")) { + var error = $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig.verify(message.speechTranscriptionConfig); + if (error) + return "speechTranscriptionConfig." + error; + } + if (message.textDetectionConfig != null && message.hasOwnProperty("textDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1.TextDetectionConfig.verify(message.textDetectionConfig); + if (error) + return "textDetectionConfig." + error; + } + if (message.personDetectionConfig != null && message.hasOwnProperty("personDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1.PersonDetectionConfig.verify(message.personDetectionConfig); + if (error) + return "personDetectionConfig." + error; + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + var error = $root.google.cloud.videointelligence.v1.ObjectTrackingConfig.verify(message.objectTrackingConfig); + if (error) + return "objectTrackingConfig." + error; + } + return null; + }; + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.VideoContext} VideoContext + */ + VideoContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.VideoContext) + return object; + var message = new $root.google.cloud.videointelligence.v1.VideoContext(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segments[i]); + } + } + if (object.labelDetectionConfig != null) { + if (typeof object.labelDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.labelDetectionConfig: object expected"); + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1.LabelDetectionConfig.fromObject(object.labelDetectionConfig); + } + if (object.shotChangeDetectionConfig != null) { + if (typeof object.shotChangeDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.shotChangeDetectionConfig: object expected"); + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig.fromObject(object.shotChangeDetectionConfig); + } + if (object.explicitContentDetectionConfig != null) { + if (typeof object.explicitContentDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.explicitContentDetectionConfig: object expected"); + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.fromObject(object.explicitContentDetectionConfig); + } + if (object.faceDetectionConfig != null) { + if (typeof object.faceDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.faceDetectionConfig: object expected"); + message.faceDetectionConfig = $root.google.cloud.videointelligence.v1.FaceDetectionConfig.fromObject(object.faceDetectionConfig); + } + if (object.speechTranscriptionConfig != null) { + if (typeof object.speechTranscriptionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.speechTranscriptionConfig: object expected"); + message.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig.fromObject(object.speechTranscriptionConfig); + } + if (object.textDetectionConfig != null) { + if (typeof object.textDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.textDetectionConfig: object expected"); + message.textDetectionConfig = $root.google.cloud.videointelligence.v1.TextDetectionConfig.fromObject(object.textDetectionConfig); + } + if (object.personDetectionConfig != null) { + if (typeof object.personDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.personDetectionConfig: object expected"); + message.personDetectionConfig = $root.google.cloud.videointelligence.v1.PersonDetectionConfig.fromObject(object.personDetectionConfig); + } + if (object.objectTrackingConfig != null) { + if (typeof object.objectTrackingConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoContext.objectTrackingConfig: object expected"); + message.objectTrackingConfig = $root.google.cloud.videointelligence.v1.ObjectTrackingConfig.fromObject(object.objectTrackingConfig); + } + return message; + }; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1.VideoContext} message VideoContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) { + object.labelDetectionConfig = null; + object.shotChangeDetectionConfig = null; + object.explicitContentDetectionConfig = null; + object.faceDetectionConfig = null; + object.speechTranscriptionConfig = null; + object.textDetectionConfig = null; + object.personDetectionConfig = null; + object.objectTrackingConfig = null; + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segments[j], options); + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) + object.labelDetectionConfig = $root.google.cloud.videointelligence.v1.LabelDetectionConfig.toObject(message.labelDetectionConfig, options); + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) + object.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig.toObject(message.shotChangeDetectionConfig, options); + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) + object.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.toObject(message.explicitContentDetectionConfig, options); + if (message.faceDetectionConfig != null && message.hasOwnProperty("faceDetectionConfig")) + object.faceDetectionConfig = $root.google.cloud.videointelligence.v1.FaceDetectionConfig.toObject(message.faceDetectionConfig, options); + if (message.speechTranscriptionConfig != null && message.hasOwnProperty("speechTranscriptionConfig")) + object.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig.toObject(message.speechTranscriptionConfig, options); + if (message.textDetectionConfig != null && message.hasOwnProperty("textDetectionConfig")) + object.textDetectionConfig = $root.google.cloud.videointelligence.v1.TextDetectionConfig.toObject(message.textDetectionConfig, options); + if (message.personDetectionConfig != null && message.hasOwnProperty("personDetectionConfig")) + object.personDetectionConfig = $root.google.cloud.videointelligence.v1.PersonDetectionConfig.toObject(message.personDetectionConfig, options); + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) + object.objectTrackingConfig = $root.google.cloud.videointelligence.v1.ObjectTrackingConfig.toObject(message.objectTrackingConfig, options); + return object; + }; + + /** + * Converts this VideoContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.VideoContext + * @instance + * @returns {Object.} JSON object + */ + VideoContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.VideoContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.VideoContext"; + }; + + return VideoContext; + })(); + + /** + * Feature enum. + * @name google.cloud.videointelligence.v1.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} LABEL_DETECTION=1 LABEL_DETECTION value + * @property {number} SHOT_CHANGE_DETECTION=2 SHOT_CHANGE_DETECTION value + * @property {number} EXPLICIT_CONTENT_DETECTION=3 EXPLICIT_CONTENT_DETECTION value + * @property {number} FACE_DETECTION=4 FACE_DETECTION value + * @property {number} SPEECH_TRANSCRIPTION=6 SPEECH_TRANSCRIPTION value + * @property {number} TEXT_DETECTION=7 TEXT_DETECTION value + * @property {number} OBJECT_TRACKING=9 OBJECT_TRACKING value + * @property {number} LOGO_RECOGNITION=12 LOGO_RECOGNITION value + * @property {number} PERSON_DETECTION=14 PERSON_DETECTION value + */ + v1.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LABEL_DETECTION"] = 1; + values[valuesById[2] = "SHOT_CHANGE_DETECTION"] = 2; + values[valuesById[3] = "EXPLICIT_CONTENT_DETECTION"] = 3; + values[valuesById[4] = "FACE_DETECTION"] = 4; + values[valuesById[6] = "SPEECH_TRANSCRIPTION"] = 6; + values[valuesById[7] = "TEXT_DETECTION"] = 7; + values[valuesById[9] = "OBJECT_TRACKING"] = 9; + values[valuesById[12] = "LOGO_RECOGNITION"] = 12; + values[valuesById[14] = "PERSON_DETECTION"] = 14; + return values; + })(); + + /** + * LabelDetectionMode enum. + * @name google.cloud.videointelligence.v1.LabelDetectionMode + * @enum {number} + * @property {number} LABEL_DETECTION_MODE_UNSPECIFIED=0 LABEL_DETECTION_MODE_UNSPECIFIED value + * @property {number} SHOT_MODE=1 SHOT_MODE value + * @property {number} FRAME_MODE=2 FRAME_MODE value + * @property {number} SHOT_AND_FRAME_MODE=3 SHOT_AND_FRAME_MODE value + */ + v1.LabelDetectionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LABEL_DETECTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOT_MODE"] = 1; + values[valuesById[2] = "FRAME_MODE"] = 2; + values[valuesById[3] = "SHOT_AND_FRAME_MODE"] = 3; + return values; + })(); + + /** + * Likelihood enum. + * @name google.cloud.videointelligence.v1.Likelihood + * @enum {number} + * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1.LabelDetectionConfig = (function() { + + /** + * Properties of a LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface ILabelDetectionConfig + * @property {google.cloud.videointelligence.v1.LabelDetectionMode|null} [labelDetectionMode] LabelDetectionConfig labelDetectionMode + * @property {boolean|null} [stationaryCamera] LabelDetectionConfig stationaryCamera + * @property {string|null} [model] LabelDetectionConfig model + * @property {number|null} [frameConfidenceThreshold] LabelDetectionConfig frameConfidenceThreshold + * @property {number|null} [videoConfidenceThreshold] LabelDetectionConfig videoConfidenceThreshold + */ + + /** + * Constructs a new LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a LabelDetectionConfig. + * @implements ILabelDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.ILabelDetectionConfig=} [properties] Properties to set + */ + function LabelDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelDetectionConfig labelDetectionMode. + * @member {google.cloud.videointelligence.v1.LabelDetectionMode} labelDetectionMode + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.labelDetectionMode = 0; + + /** + * LabelDetectionConfig stationaryCamera. + * @member {boolean} stationaryCamera + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.stationaryCamera = false; + + /** + * LabelDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.model = ""; + + /** + * LabelDetectionConfig frameConfidenceThreshold. + * @member {number} frameConfidenceThreshold + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.frameConfidenceThreshold = 0; + + /** + * LabelDetectionConfig videoConfidenceThreshold. + * @member {number} videoConfidenceThreshold + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.videoConfidenceThreshold = 0; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ILabelDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.LabelDetectionConfig} LabelDetectionConfig instance + */ + LabelDetectionConfig.create = function create(properties) { + return new LabelDetectionConfig(properties); + }; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelDetectionMode != null && Object.hasOwnProperty.call(message, "labelDetectionMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelDetectionMode); + if (message.stationaryCamera != null && Object.hasOwnProperty.call(message, "stationaryCamera")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.stationaryCamera); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.frameConfidenceThreshold != null && Object.hasOwnProperty.call(message, "frameConfidenceThreshold")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.frameConfidenceThreshold); + if (message.videoConfidenceThreshold != null && Object.hasOwnProperty.call(message, "videoConfidenceThreshold")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.videoConfidenceThreshold); + return writer; + }; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decode = function 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.videointelligence.v1.LabelDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelDetectionMode = reader.int32(); + break; + } + case 2: { + message.stationaryCamera = reader.bool(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + message.frameConfidenceThreshold = reader.float(); + break; + } + case 5: { + message.videoConfidenceThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + switch (message.labelDetectionMode) { + default: + return "labelDetectionMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + if (typeof message.stationaryCamera !== "boolean") + return "stationaryCamera: boolean expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.frameConfidenceThreshold != null && message.hasOwnProperty("frameConfidenceThreshold")) + if (typeof message.frameConfidenceThreshold !== "number") + return "frameConfidenceThreshold: number expected"; + if (message.videoConfidenceThreshold != null && message.hasOwnProperty("videoConfidenceThreshold")) + if (typeof message.videoConfidenceThreshold !== "number") + return "videoConfidenceThreshold: number expected"; + return null; + }; + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.LabelDetectionConfig} LabelDetectionConfig + */ + LabelDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.LabelDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.LabelDetectionConfig(); + switch (object.labelDetectionMode) { + default: + if (typeof object.labelDetectionMode === "number") { + message.labelDetectionMode = object.labelDetectionMode; + break; + } + break; + case "LABEL_DETECTION_MODE_UNSPECIFIED": + case 0: + message.labelDetectionMode = 0; + break; + case "SHOT_MODE": + case 1: + message.labelDetectionMode = 1; + break; + case "FRAME_MODE": + case 2: + message.labelDetectionMode = 2; + break; + case "SHOT_AND_FRAME_MODE": + case 3: + message.labelDetectionMode = 3; + break; + } + if (object.stationaryCamera != null) + message.stationaryCamera = Boolean(object.stationaryCamera); + if (object.model != null) + message.model = String(object.model); + if (object.frameConfidenceThreshold != null) + message.frameConfidenceThreshold = Number(object.frameConfidenceThreshold); + if (object.videoConfidenceThreshold != null) + message.videoConfidenceThreshold = Number(object.videoConfidenceThreshold); + return message; + }; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.LabelDetectionConfig} message LabelDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelDetectionMode = options.enums === String ? "LABEL_DETECTION_MODE_UNSPECIFIED" : 0; + object.stationaryCamera = false; + object.model = ""; + object.frameConfidenceThreshold = 0; + object.videoConfidenceThreshold = 0; + } + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + object.labelDetectionMode = options.enums === String ? $root.google.cloud.videointelligence.v1.LabelDetectionMode[message.labelDetectionMode] === undefined ? message.labelDetectionMode : $root.google.cloud.videointelligence.v1.LabelDetectionMode[message.labelDetectionMode] : message.labelDetectionMode; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + object.stationaryCamera = message.stationaryCamera; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.frameConfidenceThreshold != null && message.hasOwnProperty("frameConfidenceThreshold")) + object.frameConfidenceThreshold = options.json && !isFinite(message.frameConfidenceThreshold) ? String(message.frameConfidenceThreshold) : message.frameConfidenceThreshold; + if (message.videoConfidenceThreshold != null && message.hasOwnProperty("videoConfidenceThreshold")) + object.videoConfidenceThreshold = options.json && !isFinite(message.videoConfidenceThreshold) ? String(message.videoConfidenceThreshold) : message.videoConfidenceThreshold; + return object; + }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + LabelDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.LabelDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.LabelDetectionConfig"; + }; + + return LabelDetectionConfig; + })(); + + v1.ShotChangeDetectionConfig = (function() { + + /** + * Properties of a ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface IShotChangeDetectionConfig + * @property {string|null} [model] ShotChangeDetectionConfig model + */ + + /** + * Constructs a new ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a ShotChangeDetectionConfig. + * @implements IShotChangeDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.IShotChangeDetectionConfig=} [properties] Properties to set + */ + function ShotChangeDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShotChangeDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @instance + */ + ShotChangeDetectionConfig.prototype.model = ""; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IShotChangeDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ShotChangeDetectionConfig} ShotChangeDetectionConfig instance + */ + ShotChangeDetectionConfig.create = function create(properties) { + return new ShotChangeDetectionConfig(properties); + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decode = function 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.videointelligence.v1.ShotChangeDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShotChangeDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + */ + ShotChangeDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.ShotChangeDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ShotChangeDetectionConfig} message ShotChangeDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShotChangeDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ShotChangeDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ShotChangeDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShotChangeDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ShotChangeDetectionConfig"; + }; + + return ShotChangeDetectionConfig; + })(); + + v1.ObjectTrackingConfig = (function() { + + /** + * Properties of an ObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface IObjectTrackingConfig + * @property {string|null} [model] ObjectTrackingConfig model + */ + + /** + * Constructs a new ObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an ObjectTrackingConfig. + * @implements IObjectTrackingConfig + * @constructor + * @param {google.cloud.videointelligence.v1.IObjectTrackingConfig=} [properties] Properties to set + */ + function ObjectTrackingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @instance + */ + ObjectTrackingConfig.prototype.model = ""; + + /** + * Creates a new ObjectTrackingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ObjectTrackingConfig} ObjectTrackingConfig instance + */ + ObjectTrackingConfig.create = function create(properties) { + return new ObjectTrackingConfig(properties); + }; + + /** + * Encodes the specified ObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingConfig} message ObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingConfig} message ObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ObjectTrackingConfig} ObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingConfig.decode = function 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.videointelligence.v1.ObjectTrackingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ObjectTrackingConfig} ObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ObjectTrackingConfig} ObjectTrackingConfig + */ + ObjectTrackingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ObjectTrackingConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.ObjectTrackingConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1.ObjectTrackingConfig} message ObjectTrackingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ObjectTrackingConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ObjectTrackingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ObjectTrackingConfig"; + }; + + return ObjectTrackingConfig; + })(); + + v1.FaceDetectionConfig = (function() { + + /** + * Properties of a FaceDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface IFaceDetectionConfig + * @property {string|null} [model] FaceDetectionConfig model + * @property {boolean|null} [includeBoundingBoxes] FaceDetectionConfig includeBoundingBoxes + * @property {boolean|null} [includeAttributes] FaceDetectionConfig includeAttributes + */ + + /** + * Constructs a new FaceDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a FaceDetectionConfig. + * @implements IFaceDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.IFaceDetectionConfig=} [properties] Properties to set + */ + function FaceDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.model = ""; + + /** + * FaceDetectionConfig includeBoundingBoxes. + * @member {boolean} includeBoundingBoxes + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.includeBoundingBoxes = false; + + /** + * FaceDetectionConfig includeAttributes. + * @member {boolean} includeAttributes + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.includeAttributes = false; + + /** + * Creates a new FaceDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IFaceDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.FaceDetectionConfig} FaceDetectionConfig instance + */ + FaceDetectionConfig.create = function create(properties) { + return new FaceDetectionConfig(properties); + }; + + /** + * Encodes the specified FaceDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IFaceDetectionConfig} message FaceDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.includeBoundingBoxes != null && Object.hasOwnProperty.call(message, "includeBoundingBoxes")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeBoundingBoxes); + if (message.includeAttributes != null && Object.hasOwnProperty.call(message, "includeAttributes")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.includeAttributes); + return writer; + }; + + /** + * Encodes the specified FaceDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IFaceDetectionConfig} message FaceDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.FaceDetectionConfig} FaceDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionConfig.decode = function 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.videointelligence.v1.FaceDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.includeBoundingBoxes = reader.bool(); + break; + } + case 5: { + message.includeAttributes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.FaceDetectionConfig} FaceDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + if (typeof message.includeBoundingBoxes !== "boolean") + return "includeBoundingBoxes: boolean expected"; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + if (typeof message.includeAttributes !== "boolean") + return "includeAttributes: boolean expected"; + return null; + }; + + /** + * Creates a FaceDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.FaceDetectionConfig} FaceDetectionConfig + */ + FaceDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.FaceDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.FaceDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + if (object.includeBoundingBoxes != null) + message.includeBoundingBoxes = Boolean(object.includeBoundingBoxes); + if (object.includeAttributes != null) + message.includeAttributes = Boolean(object.includeAttributes); + return message; + }; + + /** + * Creates a plain object from a FaceDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.FaceDetectionConfig} message FaceDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.includeBoundingBoxes = false; + object.includeAttributes = false; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + object.includeBoundingBoxes = message.includeBoundingBoxes; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + object.includeAttributes = message.includeAttributes; + return object; + }; + + /** + * Converts this FaceDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + FaceDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.FaceDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.FaceDetectionConfig"; + }; + + return FaceDetectionConfig; + })(); + + v1.PersonDetectionConfig = (function() { + + /** + * Properties of a PersonDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface IPersonDetectionConfig + * @property {boolean|null} [includeBoundingBoxes] PersonDetectionConfig includeBoundingBoxes + * @property {boolean|null} [includePoseLandmarks] PersonDetectionConfig includePoseLandmarks + * @property {boolean|null} [includeAttributes] PersonDetectionConfig includeAttributes + */ + + /** + * Constructs a new PersonDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a PersonDetectionConfig. + * @implements IPersonDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.IPersonDetectionConfig=} [properties] Properties to set + */ + function PersonDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonDetectionConfig includeBoundingBoxes. + * @member {boolean} includeBoundingBoxes + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @instance + */ + PersonDetectionConfig.prototype.includeBoundingBoxes = false; + + /** + * PersonDetectionConfig includePoseLandmarks. + * @member {boolean} includePoseLandmarks + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @instance + */ + PersonDetectionConfig.prototype.includePoseLandmarks = false; + + /** + * PersonDetectionConfig includeAttributes. + * @member {boolean} includeAttributes + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @instance + */ + PersonDetectionConfig.prototype.includeAttributes = false; + + /** + * Creates a new PersonDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IPersonDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.PersonDetectionConfig} PersonDetectionConfig instance + */ + PersonDetectionConfig.create = function create(properties) { + return new PersonDetectionConfig(properties); + }; + + /** + * Encodes the specified PersonDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IPersonDetectionConfig} message PersonDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeBoundingBoxes != null && Object.hasOwnProperty.call(message, "includeBoundingBoxes")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.includeBoundingBoxes); + if (message.includePoseLandmarks != null && Object.hasOwnProperty.call(message, "includePoseLandmarks")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includePoseLandmarks); + if (message.includeAttributes != null && Object.hasOwnProperty.call(message, "includeAttributes")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.includeAttributes); + return writer; + }; + + /** + * Encodes the specified PersonDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IPersonDetectionConfig} message PersonDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.PersonDetectionConfig} PersonDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionConfig.decode = function 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.videointelligence.v1.PersonDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.includeBoundingBoxes = reader.bool(); + break; + } + case 2: { + message.includePoseLandmarks = reader.bool(); + break; + } + case 3: { + message.includeAttributes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.PersonDetectionConfig} PersonDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + if (typeof message.includeBoundingBoxes !== "boolean") + return "includeBoundingBoxes: boolean expected"; + if (message.includePoseLandmarks != null && message.hasOwnProperty("includePoseLandmarks")) + if (typeof message.includePoseLandmarks !== "boolean") + return "includePoseLandmarks: boolean expected"; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + if (typeof message.includeAttributes !== "boolean") + return "includeAttributes: boolean expected"; + return null; + }; + + /** + * Creates a PersonDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.PersonDetectionConfig} PersonDetectionConfig + */ + PersonDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.PersonDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.PersonDetectionConfig(); + if (object.includeBoundingBoxes != null) + message.includeBoundingBoxes = Boolean(object.includeBoundingBoxes); + if (object.includePoseLandmarks != null) + message.includePoseLandmarks = Boolean(object.includePoseLandmarks); + if (object.includeAttributes != null) + message.includeAttributes = Boolean(object.includeAttributes); + return message; + }; + + /** + * Creates a plain object from a PersonDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.PersonDetectionConfig} message PersonDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.includeBoundingBoxes = false; + object.includePoseLandmarks = false; + object.includeAttributes = false; + } + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + object.includeBoundingBoxes = message.includeBoundingBoxes; + if (message.includePoseLandmarks != null && message.hasOwnProperty("includePoseLandmarks")) + object.includePoseLandmarks = message.includePoseLandmarks; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + object.includeAttributes = message.includeAttributes; + return object; + }; + + /** + * Converts this PersonDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + PersonDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.PersonDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.PersonDetectionConfig"; + }; + + return PersonDetectionConfig; + })(); + + v1.ExplicitContentDetectionConfig = (function() { + + /** + * Properties of an ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface IExplicitContentDetectionConfig + * @property {string|null} [model] ExplicitContentDetectionConfig model + */ + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an ExplicitContentDetectionConfig. + * @implements IExplicitContentDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.IExplicitContentDetectionConfig=} [properties] Properties to set + */ + function ExplicitContentDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @instance + */ + ExplicitContentDetectionConfig.prototype.model = ""; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig instance + */ + ExplicitContentDetectionConfig.create = function create(properties) { + return new ExplicitContentDetectionConfig(properties); + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decode = function 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.videointelligence.v1.ExplicitContentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + */ + ExplicitContentDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ExplicitContentDetectionConfig} message ExplicitContentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ExplicitContentDetectionConfig"; + }; + + return ExplicitContentDetectionConfig; + })(); + + v1.TextDetectionConfig = (function() { + + /** + * Properties of a TextDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface ITextDetectionConfig + * @property {Array.|null} [languageHints] TextDetectionConfig languageHints + * @property {string|null} [model] TextDetectionConfig model + */ + + /** + * Constructs a new TextDetectionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a TextDetectionConfig. + * @implements ITextDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.ITextDetectionConfig=} [properties] Properties to set + */ + function TextDetectionConfig(properties) { + this.languageHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextDetectionConfig languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @instance + */ + TextDetectionConfig.prototype.languageHints = $util.emptyArray; + + /** + * TextDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @instance + */ + TextDetectionConfig.prototype.model = ""; + + /** + * Creates a new TextDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ITextDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.TextDetectionConfig} TextDetectionConfig instance + */ + TextDetectionConfig.create = function create(properties) { + return new TextDetectionConfig(properties); + }; + + /** + * Encodes the specified TextDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.TextDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ITextDetectionConfig} message TextDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + return writer; + }; + + /** + * Encodes the specified TextDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.ITextDetectionConfig} message TextDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.TextDetectionConfig} TextDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextDetectionConfig.decode = function 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.videointelligence.v1.TextDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + } + case 2: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.TextDetectionConfig} TextDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a TextDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.TextDetectionConfig} TextDetectionConfig + */ + TextDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.TextDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.TextDetectionConfig(); + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.videointelligence.v1.TextDetectionConfig.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a TextDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1.TextDetectionConfig} message TextDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) + object.model = ""; + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this TextDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + TextDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.TextDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.TextDetectionConfig"; + }; + + return TextDetectionConfig; + })(); + + v1.VideoSegment = (function() { + + /** + * Properties of a VideoSegment. + * @memberof google.cloud.videointelligence.v1 + * @interface IVideoSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] VideoSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] VideoSegment endTimeOffset + */ + + /** + * Constructs a new VideoSegment. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a VideoSegment. + * @implements IVideoSegment + * @constructor + * @param {google.cloud.videointelligence.v1.IVideoSegment=} [properties] Properties to set + */ + function VideoSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @instance + */ + VideoSegment.prototype.startTimeOffset = null; + + /** + * VideoSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @instance + */ + VideoSegment.prototype.endTimeOffset = null; + + /** + * Creates a new VideoSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1.IVideoSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.VideoSegment} VideoSegment instance + */ + VideoSegment.create = function create(properties) { + return new VideoSegment(properties); + }; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.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(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decode = function 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.videointelligence.v1.VideoSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoSegment.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; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.VideoSegment} VideoSegment + */ + VideoSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.VideoSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1.VideoSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoSegment.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.videointelligence.v1.VideoSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1.VideoSegment} message VideoSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeOffset = null; + object.endTimeOffset = null; + } + 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 VideoSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @instance + * @returns {Object.} JSON object + */ + VideoSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.VideoSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.VideoSegment"; + }; + + return VideoSegment; + })(); + + v1.LabelSegment = (function() { + + /** + * Properties of a LabelSegment. + * @memberof google.cloud.videointelligence.v1 + * @interface ILabelSegment + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] LabelSegment segment + * @property {number|null} [confidence] LabelSegment confidence + */ + + /** + * Constructs a new LabelSegment. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a LabelSegment. + * @implements ILabelSegment + * @constructor + * @param {google.cloud.videointelligence.v1.ILabelSegment=} [properties] Properties to set + */ + function LabelSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelSegment segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @instance + */ + LabelSegment.prototype.segment = null; + + /** + * LabelSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @instance + */ + LabelSegment.prototype.confidence = 0; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1.ILabelSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.LabelSegment} LabelSegment instance + */ + LabelSegment.create = function create(properties) { + return new LabelSegment(properties); + }; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decode = function 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.videointelligence.v1.LabelSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.LabelSegment} LabelSegment + */ + LabelSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.LabelSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1.LabelSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LabelSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1.LabelSegment} message LabelSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @instance + * @returns {Object.} JSON object + */ + LabelSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.LabelSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.LabelSegment"; + }; + + return LabelSegment; + })(); + + v1.LabelFrame = (function() { + + /** + * Properties of a LabelFrame. + * @memberof google.cloud.videointelligence.v1 + * @interface ILabelFrame + * @property {google.protobuf.IDuration|null} [timeOffset] LabelFrame timeOffset + * @property {number|null} [confidence] LabelFrame confidence + */ + + /** + * Constructs a new LabelFrame. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a LabelFrame. + * @implements ILabelFrame + * @constructor + * @param {google.cloud.videointelligence.v1.ILabelFrame=} [properties] Properties to set + */ + function LabelFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @instance + */ + LabelFrame.prototype.timeOffset = null; + + /** + * LabelFrame confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @instance + */ + LabelFrame.prototype.confidence = 0; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1.ILabelFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.LabelFrame} LabelFrame instance + */ + LabelFrame.create = function create(properties) { + return new LabelFrame(properties); + }; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decode = function 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.videointelligence.v1.LabelFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.LabelFrame} LabelFrame + */ + LabelFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.LabelFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1.LabelFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LabelFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1.LabelFrame} message LabelFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.confidence = 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @instance + * @returns {Object.} JSON object + */ + LabelFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.LabelFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.LabelFrame"; + }; + + return LabelFrame; + })(); + + v1.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.videointelligence.v1 + * @interface IEntity + * @property {string|null} [entityId] Entity entityId + * @property {string|null} [description] Entity description + * @property {string|null} [languageCode] Entity languageCode + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.videointelligence.v1.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity entityId. + * @member {string} entityId + * @memberof google.cloud.videointelligence.v1.Entity + * @instance + */ + Entity.prototype.entityId = ""; + + /** + * Entity description. + * @member {string} description + * @memberof google.cloud.videointelligence.v1.Entity + * @instance + */ + Entity.prototype.description = ""; + + /** + * Entity languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1.Entity + * @instance + */ + Entity.prototype.languageCode = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {google.cloud.videointelligence.v1.IEntity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {google.cloud.videointelligence.v1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {google.cloud.videointelligence.v1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function 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.videointelligence.v1.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.Entity) + return object; + var message = new $root.google.cloud.videointelligence.v1.Entity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {google.cloud.videointelligence.v1.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.description = ""; + object.languageCode = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.Entity"; + }; + + return Entity; + })(); + + v1.LabelAnnotation = (function() { + + /** + * Properties of a LabelAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface ILabelAnnotation + * @property {google.cloud.videointelligence.v1.IEntity|null} [entity] LabelAnnotation entity + * @property {Array.|null} [categoryEntities] LabelAnnotation categoryEntities + * @property {Array.|null} [segments] LabelAnnotation segments + * @property {Array.|null} [frames] LabelAnnotation frames + * @property {string|null} [version] LabelAnnotation version + */ + + /** + * Constructs a new LabelAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a LabelAnnotation. + * @implements ILabelAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.ILabelAnnotation=} [properties] Properties to set + */ + function LabelAnnotation(properties) { + this.categoryEntities = []; + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelAnnotation entity. + * @member {google.cloud.videointelligence.v1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.entity = null; + + /** + * LabelAnnotation categoryEntities. + * @member {Array.} categoryEntities + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.categoryEntities = $util.emptyArray; + + /** + * LabelAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.segments = $util.emptyArray; + + /** + * LabelAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.frames = $util.emptyArray; + + /** + * LabelAnnotation version. + * @member {string} version + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.version = ""; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ILabelAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.LabelAnnotation} LabelAnnotation instance + */ + LabelAnnotation.create = function create(properties) { + return new LabelAnnotation(properties); + }; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.LabelAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.categoryEntities != null && message.categoryEntities.length) + for (var i = 0; i < message.categoryEntities.length; ++i) + $root.google.cloud.videointelligence.v1.Entity.encode(message.categoryEntities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1.LabelSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1.LabelFrame.encode(message.frames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LabelAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decode = function 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.videointelligence.v1.LabelAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.categoryEntities && message.categoryEntities.length)) + message.categoryEntities = []; + message.categoryEntities.push($root.google.cloud.videointelligence.v1.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1.LabelSegment.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1.LabelFrame.decode(reader, reader.uint32())); + break; + } + case 5: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.categoryEntities != null && message.hasOwnProperty("categoryEntities")) { + if (!Array.isArray(message.categoryEntities)) + return "categoryEntities: array expected"; + for (var i = 0; i < message.categoryEntities.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.Entity.verify(message.categoryEntities[i]); + if (error) + return "categoryEntities." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.LabelAnnotation} LabelAnnotation + */ + LabelAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.LabelAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.LabelAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1.Entity.fromObject(object.entity); + } + if (object.categoryEntities) { + if (!Array.isArray(object.categoryEntities)) + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.categoryEntities: array expected"); + message.categoryEntities = []; + for (var i = 0; i < object.categoryEntities.length; ++i) { + if (typeof object.categoryEntities[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.categoryEntities: object expected"); + message.categoryEntities[i] = $root.google.cloud.videointelligence.v1.Entity.fromObject(object.categoryEntities[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1.LabelSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LabelAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1.LabelFrame.fromObject(object.frames[i]); + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1.LabelAnnotation} message LabelAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categoryEntities = []; + object.segments = []; + object.frames = []; + } + if (options.defaults) { + object.entity = null; + object.version = ""; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1.Entity.toObject(message.entity, options); + if (message.categoryEntities && message.categoryEntities.length) { + object.categoryEntities = []; + for (var j = 0; j < message.categoryEntities.length; ++j) + object.categoryEntities[j] = $root.google.cloud.videointelligence.v1.Entity.toObject(message.categoryEntities[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1.LabelSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1.LabelFrame.toObject(message.frames[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this LabelAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @instance + * @returns {Object.} JSON object + */ + LabelAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.LabelAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.LabelAnnotation"; + }; + + return LabelAnnotation; + })(); + + v1.ExplicitContentFrame = (function() { + + /** + * Properties of an ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1 + * @interface IExplicitContentFrame + * @property {google.protobuf.IDuration|null} [timeOffset] ExplicitContentFrame timeOffset + * @property {google.cloud.videointelligence.v1.Likelihood|null} [pornographyLikelihood] ExplicitContentFrame pornographyLikelihood + */ + + /** + * Constructs a new ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an ExplicitContentFrame. + * @implements IExplicitContentFrame + * @constructor + * @param {google.cloud.videointelligence.v1.IExplicitContentFrame=} [properties] Properties to set + */ + function ExplicitContentFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.timeOffset = null; + + /** + * ExplicitContentFrame pornographyLikelihood. + * @member {google.cloud.videointelligence.v1.Likelihood} pornographyLikelihood + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.pornographyLikelihood = 0; + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ExplicitContentFrame} ExplicitContentFrame instance + */ + ExplicitContentFrame.create = function create(properties) { + return new ExplicitContentFrame(properties); + }; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pornographyLikelihood != null && Object.hasOwnProperty.call(message, "pornographyLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pornographyLikelihood); + return writer; + }; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decode = function 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.videointelligence.v1.ExplicitContentFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pornographyLikelihood = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + switch (message.pornographyLikelihood) { + default: + return "pornographyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ExplicitContentFrame} ExplicitContentFrame + */ + ExplicitContentFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ExplicitContentFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1.ExplicitContentFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ExplicitContentFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + switch (object.pornographyLikelihood) { + default: + if (typeof object.pornographyLikelihood === "number") { + message.pornographyLikelihood = object.pornographyLikelihood; + break; + } + break; + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.pornographyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.pornographyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.pornographyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.pornographyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.pornographyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.pornographyLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1.ExplicitContentFrame} message ExplicitContentFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.pornographyLikelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + object.pornographyLikelihood = options.enums === String ? $root.google.cloud.videointelligence.v1.Likelihood[message.pornographyLikelihood] === undefined ? message.pornographyLikelihood : $root.google.cloud.videointelligence.v1.Likelihood[message.pornographyLikelihood] : message.pornographyLikelihood; + return object; + }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ExplicitContentFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ExplicitContentFrame"; + }; + + return ExplicitContentFrame; + })(); + + v1.ExplicitContentAnnotation = (function() { + + /** + * Properties of an ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface IExplicitContentAnnotation + * @property {Array.|null} [frames] ExplicitContentAnnotation frames + * @property {string|null} [version] ExplicitContentAnnotation version + */ + + /** + * Constructs a new ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an ExplicitContentAnnotation. + * @implements IExplicitContentAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.IExplicitContentAnnotation=} [properties] Properties to set + */ + function ExplicitContentAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @instance + */ + ExplicitContentAnnotation.prototype.frames = $util.emptyArray; + + /** + * ExplicitContentAnnotation version. + * @member {string} version + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @instance + */ + ExplicitContentAnnotation.prototype.version = ""; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ExplicitContentAnnotation} ExplicitContentAnnotation instance + */ + ExplicitContentAnnotation.create = function create(properties) { + return new ExplicitContentAnnotation(properties); + }; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1.ExplicitContentFrame.encode(message.frames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ExplicitContentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decode = function 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.videointelligence.v1.ExplicitContentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1.ExplicitContentFrame.decode(reader, reader.uint32())); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.ExplicitContentFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates an ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ExplicitContentAnnotation} ExplicitContentAnnotation + */ + ExplicitContentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation(); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1.ExplicitContentAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ExplicitContentAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1.ExplicitContentFrame.fromObject(object.frames[i]); + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ExplicitContentAnnotation} message ExplicitContentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) + object.version = ""; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1.ExplicitContentFrame.toObject(message.frames[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ExplicitContentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ExplicitContentAnnotation"; + }; + + return ExplicitContentAnnotation; + })(); + + v1.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1 + * @interface INormalizedBoundingBox + * @property {number|null} [left] NormalizedBoundingBox left + * @property {number|null} [top] NormalizedBoundingBox top + * @property {number|null} [right] NormalizedBoundingBox right + * @property {number|null} [bottom] NormalizedBoundingBox bottom + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.videointelligence.v1.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox left. + * @member {number} left + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.left = 0; + + /** + * NormalizedBoundingBox top. + * @member {number} top + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.top = 0; + + /** + * NormalizedBoundingBox right. + * @member {number} right + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.right = 0; + + /** + * NormalizedBoundingBox bottom. + * @member {number} bottom + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.bottom = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.left); + if (message.top != null && Object.hasOwnProperty.call(message, "top")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.top); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.right); + if (message.bottom != null && Object.hasOwnProperty.call(message, "bottom")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.bottom); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function 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.videointelligence.v1.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.left = reader.float(); + break; + } + case 2: { + message.top = reader.float(); + break; + } + case 3: { + message.right = reader.float(); + break; + } + case 4: { + message.bottom = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.left != null && message.hasOwnProperty("left")) + if (typeof message.left !== "number") + return "left: number expected"; + if (message.top != null && message.hasOwnProperty("top")) + if (typeof message.top !== "number") + return "top: number expected"; + if (message.right != null && message.hasOwnProperty("right")) + if (typeof message.right !== "number") + return "right: number expected"; + if (message.bottom != null && message.hasOwnProperty("bottom")) + if (typeof message.bottom !== "number") + return "bottom: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.NormalizedBoundingBox) + return object; + var message = new $root.google.cloud.videointelligence.v1.NormalizedBoundingBox(); + if (object.left != null) + message.left = Number(object.left); + if (object.top != null) + message.top = Number(object.top); + if (object.right != null) + message.right = Number(object.right); + if (object.bottom != null) + message.bottom = Number(object.bottom); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.left = 0; + object.top = 0; + object.right = 0; + object.bottom = 0; + } + if (message.left != null && message.hasOwnProperty("left")) + object.left = options.json && !isFinite(message.left) ? String(message.left) : message.left; + if (message.top != null && message.hasOwnProperty("top")) + object.top = options.json && !isFinite(message.top) ? String(message.top) : message.top; + if (message.right != null && message.hasOwnProperty("right")) + object.right = options.json && !isFinite(message.right) ? String(message.right) : message.right; + if (message.bottom != null && message.hasOwnProperty("bottom")) + object.bottom = options.json && !isFinite(message.bottom) ? String(message.bottom) : message.bottom; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + v1.FaceDetectionAnnotation = (function() { + + /** + * Properties of a FaceDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface IFaceDetectionAnnotation + * @property {Array.|null} [tracks] FaceDetectionAnnotation tracks + * @property {Uint8Array|null} [thumbnail] FaceDetectionAnnotation thumbnail + * @property {string|null} [version] FaceDetectionAnnotation version + */ + + /** + * Constructs a new FaceDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a FaceDetectionAnnotation. + * @implements IFaceDetectionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.IFaceDetectionAnnotation=} [properties] Properties to set + */ + function FaceDetectionAnnotation(properties) { + this.tracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceDetectionAnnotation tracks. + * @member {Array.} tracks + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @instance + */ + FaceDetectionAnnotation.prototype.tracks = $util.emptyArray; + + /** + * FaceDetectionAnnotation thumbnail. + * @member {Uint8Array} thumbnail + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @instance + */ + FaceDetectionAnnotation.prototype.thumbnail = $util.newBuffer([]); + + /** + * FaceDetectionAnnotation version. + * @member {string} version + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @instance + */ + FaceDetectionAnnotation.prototype.version = ""; + + /** + * Creates a new FaceDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IFaceDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.FaceDetectionAnnotation} FaceDetectionAnnotation instance + */ + FaceDetectionAnnotation.create = function create(properties) { + return new FaceDetectionAnnotation(properties); + }; + + /** + * Encodes the specified FaceDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IFaceDetectionAnnotation} message FaceDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tracks != null && message.tracks.length) + for (var i = 0; i < message.tracks.length; ++i) + $root.google.cloud.videointelligence.v1.Track.encode(message.tracks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thumbnail); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified FaceDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IFaceDetectionAnnotation} message FaceDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.FaceDetectionAnnotation} FaceDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionAnnotation.decode = function 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.videointelligence.v1.FaceDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.tracks && message.tracks.length)) + message.tracks = []; + message.tracks.push($root.google.cloud.videointelligence.v1.Track.decode(reader, reader.uint32())); + break; + } + case 4: { + message.thumbnail = reader.bytes(); + break; + } + case 5: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.FaceDetectionAnnotation} FaceDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceDetectionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tracks != null && message.hasOwnProperty("tracks")) { + if (!Array.isArray(message.tracks)) + return "tracks: array expected"; + for (var i = 0; i < message.tracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.Track.verify(message.tracks[i]); + if (error) + return "tracks." + error; + } + } + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) + return "thumbnail: buffer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a FaceDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.FaceDetectionAnnotation} FaceDetectionAnnotation + */ + FaceDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.FaceDetectionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.FaceDetectionAnnotation(); + if (object.tracks) { + if (!Array.isArray(object.tracks)) + throw TypeError(".google.cloud.videointelligence.v1.FaceDetectionAnnotation.tracks: array expected"); + message.tracks = []; + for (var i = 0; i < object.tracks.length; ++i) { + if (typeof object.tracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.FaceDetectionAnnotation.tracks: object expected"); + message.tracks[i] = $root.google.cloud.videointelligence.v1.Track.fromObject(object.tracks[i]); + } + } + if (object.thumbnail != null) + if (typeof object.thumbnail === "string") + $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); + else if (object.thumbnail.length >= 0) + message.thumbnail = object.thumbnail; + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a FaceDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.FaceDetectionAnnotation} message FaceDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tracks = []; + if (options.defaults) { + if (options.bytes === String) + object.thumbnail = ""; + else { + object.thumbnail = []; + if (options.bytes !== Array) + object.thumbnail = $util.newBuffer(object.thumbnail); + } + object.version = ""; + } + if (message.tracks && message.tracks.length) { + object.tracks = []; + for (var j = 0; j < message.tracks.length; ++j) + object.tracks[j] = $root.google.cloud.videointelligence.v1.Track.toObject(message.tracks[j], options); + } + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this FaceDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.FaceDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.FaceDetectionAnnotation"; + }; + + return FaceDetectionAnnotation; + })(); + + v1.PersonDetectionAnnotation = (function() { + + /** + * Properties of a PersonDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface IPersonDetectionAnnotation + * @property {Array.|null} [tracks] PersonDetectionAnnotation tracks + * @property {string|null} [version] PersonDetectionAnnotation version + */ + + /** + * Constructs a new PersonDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a PersonDetectionAnnotation. + * @implements IPersonDetectionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.IPersonDetectionAnnotation=} [properties] Properties to set + */ + function PersonDetectionAnnotation(properties) { + this.tracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonDetectionAnnotation tracks. + * @member {Array.} tracks + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @instance + */ + PersonDetectionAnnotation.prototype.tracks = $util.emptyArray; + + /** + * PersonDetectionAnnotation version. + * @member {string} version + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @instance + */ + PersonDetectionAnnotation.prototype.version = ""; + + /** + * Creates a new PersonDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IPersonDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.PersonDetectionAnnotation} PersonDetectionAnnotation instance + */ + PersonDetectionAnnotation.create = function create(properties) { + return new PersonDetectionAnnotation(properties); + }; + + /** + * Encodes the specified PersonDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IPersonDetectionAnnotation} message PersonDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tracks != null && message.tracks.length) + for (var i = 0; i < message.tracks.length; ++i) + $root.google.cloud.videointelligence.v1.Track.encode(message.tracks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified PersonDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.PersonDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IPersonDetectionAnnotation} message PersonDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.PersonDetectionAnnotation} PersonDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionAnnotation.decode = function 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.videointelligence.v1.PersonDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tracks && message.tracks.length)) + message.tracks = []; + message.tracks.push($root.google.cloud.videointelligence.v1.Track.decode(reader, reader.uint32())); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.PersonDetectionAnnotation} PersonDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonDetectionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tracks != null && message.hasOwnProperty("tracks")) { + if (!Array.isArray(message.tracks)) + return "tracks: array expected"; + for (var i = 0; i < message.tracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.Track.verify(message.tracks[i]); + if (error) + return "tracks." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a PersonDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.PersonDetectionAnnotation} PersonDetectionAnnotation + */ + PersonDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.PersonDetectionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.PersonDetectionAnnotation(); + if (object.tracks) { + if (!Array.isArray(object.tracks)) + throw TypeError(".google.cloud.videointelligence.v1.PersonDetectionAnnotation.tracks: array expected"); + message.tracks = []; + for (var i = 0; i < object.tracks.length; ++i) { + if (typeof object.tracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.PersonDetectionAnnotation.tracks: object expected"); + message.tracks[i] = $root.google.cloud.videointelligence.v1.Track.fromObject(object.tracks[i]); + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a PersonDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.PersonDetectionAnnotation} message PersonDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tracks = []; + if (options.defaults) + object.version = ""; + if (message.tracks && message.tracks.length) { + object.tracks = []; + for (var j = 0; j < message.tracks.length; ++j) + object.tracks[j] = $root.google.cloud.videointelligence.v1.Track.toObject(message.tracks[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this PersonDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + PersonDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.PersonDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.PersonDetectionAnnotation"; + }; + + return PersonDetectionAnnotation; + })(); + + v1.FaceSegment = (function() { + + /** + * Properties of a FaceSegment. + * @memberof google.cloud.videointelligence.v1 + * @interface IFaceSegment + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] FaceSegment segment + */ + + /** + * Constructs a new FaceSegment. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a FaceSegment. + * @implements IFaceSegment + * @constructor + * @param {google.cloud.videointelligence.v1.IFaceSegment=} [properties] Properties to set + */ + function FaceSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceSegment segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @instance + */ + FaceSegment.prototype.segment = null; + + /** + * Creates a new FaceSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1.IFaceSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.FaceSegment} FaceSegment instance + */ + FaceSegment.create = function create(properties) { + return new FaceSegment(properties); + }; + + /** + * Encodes the specified FaceSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1.IFaceSegment} message FaceSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaceSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1.IFaceSegment} message FaceSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.FaceSegment} FaceSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceSegment.decode = function 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.videointelligence.v1.FaceSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.FaceSegment} FaceSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + return null; + }; + + /** + * Creates a FaceSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.FaceSegment} FaceSegment + */ + FaceSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.FaceSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1.FaceSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.FaceSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + return message; + }; + + /** + * Creates a plain object from a FaceSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1.FaceSegment} message FaceSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.segment = null; + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + return object; + }; + + /** + * Converts this FaceSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @instance + * @returns {Object.} JSON object + */ + FaceSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.FaceSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.FaceSegment"; + }; + + return FaceSegment; + })(); + + v1.FaceFrame = (function() { + + /** + * Properties of a FaceFrame. + * @memberof google.cloud.videointelligence.v1 + * @interface IFaceFrame + * @property {Array.|null} [normalizedBoundingBoxes] FaceFrame normalizedBoundingBoxes + * @property {google.protobuf.IDuration|null} [timeOffset] FaceFrame timeOffset + */ + + /** + * Constructs a new FaceFrame. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a FaceFrame. + * @implements IFaceFrame + * @constructor + * @param {google.cloud.videointelligence.v1.IFaceFrame=} [properties] Properties to set + */ + function FaceFrame(properties) { + this.normalizedBoundingBoxes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceFrame normalizedBoundingBoxes. + * @member {Array.} normalizedBoundingBoxes + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @instance + */ + FaceFrame.prototype.normalizedBoundingBoxes = $util.emptyArray; + + /** + * FaceFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @instance + */ + FaceFrame.prototype.timeOffset = null; + + /** + * Creates a new FaceFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1.IFaceFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.FaceFrame} FaceFrame instance + */ + FaceFrame.create = function create(properties) { + return new FaceFrame(properties); + }; + + /** + * Encodes the specified FaceFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1.IFaceFrame} message FaceFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBoxes != null && message.normalizedBoundingBoxes.length) + for (var i = 0; i < message.normalizedBoundingBoxes.length; ++i) + $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.encode(message.normalizedBoundingBoxes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaceFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1.IFaceFrame} message FaceFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.FaceFrame} FaceFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceFrame.decode = function 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.videointelligence.v1.FaceFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.normalizedBoundingBoxes && message.normalizedBoundingBoxes.length)) + message.normalizedBoundingBoxes = []; + message.normalizedBoundingBoxes.push($root.google.cloud.videointelligence.v1.NormalizedBoundingBox.decode(reader, reader.uint32())); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.FaceFrame} FaceFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBoxes != null && message.hasOwnProperty("normalizedBoundingBoxes")) { + if (!Array.isArray(message.normalizedBoundingBoxes)) + return "normalizedBoundingBoxes: array expected"; + for (var i = 0; i < message.normalizedBoundingBoxes.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.verify(message.normalizedBoundingBoxes[i]); + if (error) + return "normalizedBoundingBoxes." + error; + } + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates a FaceFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.FaceFrame} FaceFrame + */ + FaceFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.FaceFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1.FaceFrame(); + if (object.normalizedBoundingBoxes) { + if (!Array.isArray(object.normalizedBoundingBoxes)) + throw TypeError(".google.cloud.videointelligence.v1.FaceFrame.normalizedBoundingBoxes: array expected"); + message.normalizedBoundingBoxes = []; + for (var i = 0; i < object.normalizedBoundingBoxes.length; ++i) { + if (typeof object.normalizedBoundingBoxes[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.FaceFrame.normalizedBoundingBoxes: object expected"); + message.normalizedBoundingBoxes[i] = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.fromObject(object.normalizedBoundingBoxes[i]); + } + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.FaceFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from a FaceFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1.FaceFrame} message FaceFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedBoundingBoxes = []; + if (options.defaults) + object.timeOffset = null; + if (message.normalizedBoundingBoxes && message.normalizedBoundingBoxes.length) { + object.normalizedBoundingBoxes = []; + for (var j = 0; j < message.normalizedBoundingBoxes.length; ++j) + object.normalizedBoundingBoxes[j] = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.toObject(message.normalizedBoundingBoxes[j], options); + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this FaceFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @instance + * @returns {Object.} JSON object + */ + FaceFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.FaceFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.FaceFrame"; + }; + + return FaceFrame; + })(); + + v1.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface IFaceAnnotation + * @property {Uint8Array|null} [thumbnail] FaceAnnotation thumbnail + * @property {Array.|null} [segments] FaceAnnotation segments + * @property {Array.|null} [frames] FaceAnnotation frames + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceAnnotation thumbnail. + * @member {Uint8Array} thumbnail + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.thumbnail = $util.newBuffer([]); + + /** + * FaceAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.segments = $util.emptyArray; + + /** + * FaceAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.thumbnail); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1.FaceSegment.encode(message.segments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1.FaceFrame.encode(message.frames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decode = function 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.videointelligence.v1.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.thumbnail = reader.bytes(); + break; + } + case 2: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1.FaceSegment.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1.FaceFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) + return "thumbnail: buffer expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.FaceSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.FaceFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.FaceAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.FaceAnnotation(); + if (object.thumbnail != null) + if (typeof object.thumbnail === "string") + $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); + else if (object.thumbnail.length >= 0) + message.thumbnail = object.thumbnail; + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1.FaceAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.FaceAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1.FaceSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1.FaceAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.FaceAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1.FaceFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segments = []; + object.frames = []; + } + if (options.defaults) + if (options.bytes === String) + object.thumbnail = ""; + else { + object.thumbnail = []; + if (options.bytes !== Array) + object.thumbnail = $util.newBuffer(object.thumbnail); + } + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1.FaceSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1.FaceFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.FaceAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.FaceAnnotation"; + }; + + return FaceAnnotation; + })(); + + v1.TimestampedObject = (function() { + + /** + * Properties of a TimestampedObject. + * @memberof google.cloud.videointelligence.v1 + * @interface ITimestampedObject + * @property {google.cloud.videointelligence.v1.INormalizedBoundingBox|null} [normalizedBoundingBox] TimestampedObject normalizedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] TimestampedObject timeOffset + * @property {Array.|null} [attributes] TimestampedObject attributes + * @property {Array.|null} [landmarks] TimestampedObject landmarks + */ + + /** + * Constructs a new TimestampedObject. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a TimestampedObject. + * @implements ITimestampedObject + * @constructor + * @param {google.cloud.videointelligence.v1.ITimestampedObject=} [properties] Properties to set + */ + function TimestampedObject(properties) { + this.attributes = []; + this.landmarks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampedObject normalizedBoundingBox. + * @member {google.cloud.videointelligence.v1.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.normalizedBoundingBox = null; + + /** + * TimestampedObject timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.timeOffset = null; + + /** + * TimestampedObject attributes. + * @member {Array.} attributes + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.attributes = $util.emptyArray; + + /** + * TimestampedObject landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.landmarks = $util.emptyArray; + + /** + * Creates a new TimestampedObject instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1.ITimestampedObject=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.TimestampedObject} TimestampedObject instance + */ + TimestampedObject.create = function create(properties) { + return new TimestampedObject(properties); + }; + + /** + * Encodes the specified TimestampedObject message. Does not implicitly {@link google.cloud.videointelligence.v1.TimestampedObject.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1.ITimestampedObject} message TimestampedObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampedObject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.videointelligence.v1.DetectedAttribute.encode(message.attributes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.videointelligence.v1.DetectedLandmark.encode(message.landmarks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimestampedObject message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TimestampedObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1.ITimestampedObject} message TimestampedObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampedObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.TimestampedObject} TimestampedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampedObject.decode = function 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.videointelligence.v1.TimestampedObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.videointelligence.v1.DetectedAttribute.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.videointelligence.v1.DetectedLandmark.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.TimestampedObject} TimestampedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampedObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampedObject message. + * @function verify + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampedObject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.verify(message.normalizedBoundingBox); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.DetectedAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.DetectedLandmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + return null; + }; + + /** + * Creates a TimestampedObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.TimestampedObject} TimestampedObject + */ + TimestampedObject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.TimestampedObject) + return object; + var message = new $root.google.cloud.videointelligence.v1.TimestampedObject(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TimestampedObject.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TimestampedObject.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.videointelligence.v1.TimestampedObject.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TimestampedObject.attributes: object expected"); + message.attributes[i] = $root.google.cloud.videointelligence.v1.DetectedAttribute.fromObject(object.attributes[i]); + } + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.videointelligence.v1.TimestampedObject.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TimestampedObject.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.videointelligence.v1.DetectedLandmark.fromObject(object.landmarks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimestampedObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1.TimestampedObject} message TimestampedObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampedObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.attributes = []; + object.landmarks = []; + } + if (options.defaults) { + object.normalizedBoundingBox = null; + object.timeOffset = null; + } + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.videointelligence.v1.DetectedAttribute.toObject(message.attributes[j], options); + } + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.videointelligence.v1.DetectedLandmark.toObject(message.landmarks[j], options); + } + return object; + }; + + /** + * Converts this TimestampedObject to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @instance + * @returns {Object.} JSON object + */ + TimestampedObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampedObject + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.TimestampedObject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampedObject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.TimestampedObject"; + }; + + return TimestampedObject; + })(); + + v1.Track = (function() { + + /** + * Properties of a Track. + * @memberof google.cloud.videointelligence.v1 + * @interface ITrack + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] Track segment + * @property {Array.|null} [timestampedObjects] Track timestampedObjects + * @property {Array.|null} [attributes] Track attributes + * @property {number|null} [confidence] Track confidence + */ + + /** + * Constructs a new Track. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a Track. + * @implements ITrack + * @constructor + * @param {google.cloud.videointelligence.v1.ITrack=} [properties] Properties to set + */ + function Track(properties) { + this.timestampedObjects = []; + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Track segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.Track + * @instance + */ + Track.prototype.segment = null; + + /** + * Track timestampedObjects. + * @member {Array.} timestampedObjects + * @memberof google.cloud.videointelligence.v1.Track + * @instance + */ + Track.prototype.timestampedObjects = $util.emptyArray; + + /** + * Track attributes. + * @member {Array.} attributes + * @memberof google.cloud.videointelligence.v1.Track + * @instance + */ + Track.prototype.attributes = $util.emptyArray; + + /** + * Track confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.Track + * @instance + */ + Track.prototype.confidence = 0; + + /** + * Creates a new Track instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {google.cloud.videointelligence.v1.ITrack=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.Track} Track instance + */ + Track.create = function create(properties) { + return new Track(properties); + }; + + /** + * Encodes the specified Track message. Does not implicitly {@link google.cloud.videointelligence.v1.Track.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {google.cloud.videointelligence.v1.ITrack} message Track message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Track.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timestampedObjects != null && message.timestampedObjects.length) + for (var i = 0; i < message.timestampedObjects.length; ++i) + $root.google.cloud.videointelligence.v1.TimestampedObject.encode(message.timestampedObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.videointelligence.v1.DetectedAttribute.encode(message.attributes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Track message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.Track.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {google.cloud.videointelligence.v1.ITrack} message Track message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Track.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Track message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.Track} Track + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Track.decode = function 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.videointelligence.v1.Track(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.timestampedObjects && message.timestampedObjects.length)) + message.timestampedObjects = []; + message.timestampedObjects.push($root.google.cloud.videointelligence.v1.TimestampedObject.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.videointelligence.v1.DetectedAttribute.decode(reader, reader.uint32())); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Track message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.Track} Track + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Track.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Track message. + * @function verify + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Track.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.timestampedObjects != null && message.hasOwnProperty("timestampedObjects")) { + if (!Array.isArray(message.timestampedObjects)) + return "timestampedObjects: array expected"; + for (var i = 0; i < message.timestampedObjects.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.TimestampedObject.verify(message.timestampedObjects[i]); + if (error) + return "timestampedObjects." + error; + } + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.DetectedAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Track message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.Track} Track + */ + Track.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.Track) + return object; + var message = new $root.google.cloud.videointelligence.v1.Track(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.Track.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + if (object.timestampedObjects) { + if (!Array.isArray(object.timestampedObjects)) + throw TypeError(".google.cloud.videointelligence.v1.Track.timestampedObjects: array expected"); + message.timestampedObjects = []; + for (var i = 0; i < object.timestampedObjects.length; ++i) { + if (typeof object.timestampedObjects[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.Track.timestampedObjects: object expected"); + message.timestampedObjects[i] = $root.google.cloud.videointelligence.v1.TimestampedObject.fromObject(object.timestampedObjects[i]); + } + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.videointelligence.v1.Track.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.Track.attributes: object expected"); + message.attributes[i] = $root.google.cloud.videointelligence.v1.DetectedAttribute.fromObject(object.attributes[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Track message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {google.cloud.videointelligence.v1.Track} message Track + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Track.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.timestampedObjects = []; + object.attributes = []; + } + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + if (message.timestampedObjects && message.timestampedObjects.length) { + object.timestampedObjects = []; + for (var j = 0; j < message.timestampedObjects.length; ++j) + object.timestampedObjects[j] = $root.google.cloud.videointelligence.v1.TimestampedObject.toObject(message.timestampedObjects[j], options); + } + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.videointelligence.v1.DetectedAttribute.toObject(message.attributes[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Track to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.Track + * @instance + * @returns {Object.} JSON object + */ + Track.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Track + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.Track + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Track.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.Track"; + }; + + return Track; + })(); + + v1.DetectedAttribute = (function() { + + /** + * Properties of a DetectedAttribute. + * @memberof google.cloud.videointelligence.v1 + * @interface IDetectedAttribute + * @property {string|null} [name] DetectedAttribute name + * @property {number|null} [confidence] DetectedAttribute confidence + * @property {string|null} [value] DetectedAttribute value + */ + + /** + * Constructs a new DetectedAttribute. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a DetectedAttribute. + * @implements IDetectedAttribute + * @constructor + * @param {google.cloud.videointelligence.v1.IDetectedAttribute=} [properties] Properties to set + */ + function DetectedAttribute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedAttribute name. + * @member {string} name + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @instance + */ + DetectedAttribute.prototype.name = ""; + + /** + * DetectedAttribute confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @instance + */ + DetectedAttribute.prototype.confidence = 0; + + /** + * DetectedAttribute value. + * @member {string} value + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @instance + */ + DetectedAttribute.prototype.value = ""; + + /** + * Creates a new DetectedAttribute instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1.IDetectedAttribute=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.DetectedAttribute} DetectedAttribute instance + */ + DetectedAttribute.create = function create(properties) { + return new DetectedAttribute(properties); + }; + + /** + * Encodes the specified DetectedAttribute message. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedAttribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1.IDetectedAttribute} message DetectedAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedAttribute.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + return writer; + }; + + /** + * Encodes the specified DetectedAttribute message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1.IDetectedAttribute} message DetectedAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.DetectedAttribute} DetectedAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedAttribute.decode = function 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.videointelligence.v1.DetectedAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.DetectedAttribute} DetectedAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedAttribute message. + * @function verify + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedAttribute.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.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a DetectedAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.DetectedAttribute} DetectedAttribute + */ + DetectedAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.DetectedAttribute) + return object; + var message = new $root.google.cloud.videointelligence.v1.DetectedAttribute(); + if (object.name != null) + message.name = String(object.name); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a DetectedAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1.DetectedAttribute} message DetectedAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.confidence = 0; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this DetectedAttribute to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @instance + * @returns {Object.} JSON object + */ + DetectedAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedAttribute + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.DetectedAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.DetectedAttribute"; + }; + + return DetectedAttribute; + })(); + + v1.DetectedLandmark = (function() { + + /** + * Properties of a DetectedLandmark. + * @memberof google.cloud.videointelligence.v1 + * @interface IDetectedLandmark + * @property {string|null} [name] DetectedLandmark name + * @property {google.cloud.videointelligence.v1.INormalizedVertex|null} [point] DetectedLandmark point + * @property {number|null} [confidence] DetectedLandmark confidence + */ + + /** + * Constructs a new DetectedLandmark. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a DetectedLandmark. + * @implements IDetectedLandmark + * @constructor + * @param {google.cloud.videointelligence.v1.IDetectedLandmark=} [properties] Properties to set + */ + function DetectedLandmark(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedLandmark name. + * @member {string} name + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @instance + */ + DetectedLandmark.prototype.name = ""; + + /** + * DetectedLandmark point. + * @member {google.cloud.videointelligence.v1.INormalizedVertex|null|undefined} point + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @instance + */ + DetectedLandmark.prototype.point = null; + + /** + * DetectedLandmark confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @instance + */ + DetectedLandmark.prototype.confidence = 0; + + /** + * Creates a new DetectedLandmark instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1.IDetectedLandmark=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.DetectedLandmark} DetectedLandmark instance + */ + DetectedLandmark.create = function create(properties) { + return new DetectedLandmark(properties); + }; + + /** + * Encodes the specified DetectedLandmark message. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedLandmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1.IDetectedLandmark} message DetectedLandmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLandmark.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.point != null && Object.hasOwnProperty.call(message, "point")) + $root.google.cloud.videointelligence.v1.NormalizedVertex.encode(message.point, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLandmark message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.DetectedLandmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1.IDetectedLandmark} message DetectedLandmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLandmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.DetectedLandmark} DetectedLandmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLandmark.decode = function 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.videointelligence.v1.DetectedLandmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.point = $root.google.cloud.videointelligence.v1.NormalizedVertex.decode(reader, reader.uint32()); + break; + } + case 3: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.DetectedLandmark} DetectedLandmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLandmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLandmark message. + * @function verify + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLandmark.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.point != null && message.hasOwnProperty("point")) { + var error = $root.google.cloud.videointelligence.v1.NormalizedVertex.verify(message.point); + if (error) + return "point." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLandmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.DetectedLandmark} DetectedLandmark + */ + DetectedLandmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.DetectedLandmark) + return object; + var message = new $root.google.cloud.videointelligence.v1.DetectedLandmark(); + if (object.name != null) + message.name = String(object.name); + if (object.point != null) { + if (typeof object.point !== "object") + throw TypeError(".google.cloud.videointelligence.v1.DetectedLandmark.point: object expected"); + message.point = $root.google.cloud.videointelligence.v1.NormalizedVertex.fromObject(object.point); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLandmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1.DetectedLandmark} message DetectedLandmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLandmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.point = null; + object.confidence = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.point != null && message.hasOwnProperty("point")) + object.point = $root.google.cloud.videointelligence.v1.NormalizedVertex.toObject(message.point, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLandmark to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @instance + * @returns {Object.} JSON object + */ + DetectedLandmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedLandmark + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.DetectedLandmark + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedLandmark.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.DetectedLandmark"; + }; + + return DetectedLandmark; + })(); + + v1.VideoAnnotationResults = (function() { + + /** + * Properties of a VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1 + * @interface IVideoAnnotationResults + * @property {string|null} [inputUri] VideoAnnotationResults inputUri + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] VideoAnnotationResults segment + * @property {Array.|null} [segmentLabelAnnotations] VideoAnnotationResults segmentLabelAnnotations + * @property {Array.|null} [segmentPresenceLabelAnnotations] VideoAnnotationResults segmentPresenceLabelAnnotations + * @property {Array.|null} [shotLabelAnnotations] VideoAnnotationResults shotLabelAnnotations + * @property {Array.|null} [shotPresenceLabelAnnotations] VideoAnnotationResults shotPresenceLabelAnnotations + * @property {Array.|null} [frameLabelAnnotations] VideoAnnotationResults frameLabelAnnotations + * @property {Array.|null} [faceAnnotations] VideoAnnotationResults faceAnnotations + * @property {Array.|null} [faceDetectionAnnotations] VideoAnnotationResults faceDetectionAnnotations + * @property {Array.|null} [shotAnnotations] VideoAnnotationResults shotAnnotations + * @property {google.cloud.videointelligence.v1.IExplicitContentAnnotation|null} [explicitAnnotation] VideoAnnotationResults explicitAnnotation + * @property {Array.|null} [speechTranscriptions] VideoAnnotationResults speechTranscriptions + * @property {Array.|null} [textAnnotations] VideoAnnotationResults textAnnotations + * @property {Array.|null} [objectAnnotations] VideoAnnotationResults objectAnnotations + * @property {Array.|null} [logoRecognitionAnnotations] VideoAnnotationResults logoRecognitionAnnotations + * @property {Array.|null} [personDetectionAnnotations] VideoAnnotationResults personDetectionAnnotations + * @property {google.rpc.IStatus|null} [error] VideoAnnotationResults error + */ + + /** + * Constructs a new VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a VideoAnnotationResults. + * @implements IVideoAnnotationResults + * @constructor + * @param {google.cloud.videointelligence.v1.IVideoAnnotationResults=} [properties] Properties to set + */ + function VideoAnnotationResults(properties) { + this.segmentLabelAnnotations = []; + this.segmentPresenceLabelAnnotations = []; + this.shotLabelAnnotations = []; + this.shotPresenceLabelAnnotations = []; + this.frameLabelAnnotations = []; + this.faceAnnotations = []; + this.faceDetectionAnnotations = []; + this.shotAnnotations = []; + this.speechTranscriptions = []; + this.textAnnotations = []; + this.objectAnnotations = []; + this.logoRecognitionAnnotations = []; + this.personDetectionAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationResults inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.inputUri = ""; + + /** + * VideoAnnotationResults segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segment = null; + + /** + * VideoAnnotationResults segmentLabelAnnotations. + * @member {Array.} segmentLabelAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults segmentPresenceLabelAnnotations. + * @member {Array.} segmentPresenceLabelAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentPresenceLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotLabelAnnotations. + * @member {Array.} shotLabelAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotPresenceLabelAnnotations. + * @member {Array.} shotPresenceLabelAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotPresenceLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults frameLabelAnnotations. + * @member {Array.} frameLabelAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.frameLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.faceAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults faceDetectionAnnotations. + * @member {Array.} faceDetectionAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.faceDetectionAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotAnnotations. + * @member {Array.} shotAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults explicitAnnotation. + * @member {google.cloud.videointelligence.v1.IExplicitContentAnnotation|null|undefined} explicitAnnotation + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.explicitAnnotation = null; + + /** + * VideoAnnotationResults speechTranscriptions. + * @member {Array.} speechTranscriptions + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.speechTranscriptions = $util.emptyArray; + + /** + * VideoAnnotationResults textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.textAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults objectAnnotations. + * @member {Array.} objectAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.objectAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults logoRecognitionAnnotations. + * @member {Array.} logoRecognitionAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.logoRecognitionAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults personDetectionAnnotations. + * @member {Array.} personDetectionAnnotations + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.personDetectionAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.error = null; + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1.IVideoAnnotationResults=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.VideoAnnotationResults} VideoAnnotationResults instance + */ + VideoAnnotationResults.create = function create(properties) { + return new VideoAnnotationResults(properties); + }; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.segmentLabelAnnotations != null && message.segmentLabelAnnotations.length) + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.LabelAnnotation.encode(message.segmentLabelAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotLabelAnnotations != null && message.shotLabelAnnotations.length) + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.LabelAnnotation.encode(message.shotLabelAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frameLabelAnnotations != null && message.frameLabelAnnotations.length) + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.LabelAnnotation.encode(message.frameLabelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.shotAnnotations != null && message.shotAnnotations.length) + for (var i = 0; i < message.shotAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.shotAnnotations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.explicitAnnotation != null && Object.hasOwnProperty.call(message, "explicitAnnotation")) + $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation.encode(message.explicitAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.speechTranscriptions != null && message.speechTranscriptions.length) + for (var i = 0; i < message.speechTranscriptions.length; ++i) + $root.google.cloud.videointelligence.v1.SpeechTranscription.encode(message.speechTranscriptions[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.TextAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.faceDetectionAnnotations != null && message.faceDetectionAnnotations.length) + for (var i = 0; i < message.faceDetectionAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.FaceDetectionAnnotation.encode(message.faceDetectionAnnotations[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.objectAnnotations != null && message.objectAnnotations.length) + for (var i = 0; i < message.objectAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation.encode(message.objectAnnotations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.logoRecognitionAnnotations != null && message.logoRecognitionAnnotations.length) + for (var i = 0; i < message.logoRecognitionAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation.encode(message.logoRecognitionAnnotations[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.personDetectionAnnotations != null && message.personDetectionAnnotations.length) + for (var i = 0; i < message.personDetectionAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.PersonDetectionAnnotation.encode(message.personDetectionAnnotations[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.segmentPresenceLabelAnnotations != null && message.segmentPresenceLabelAnnotations.length) + for (var i = 0; i < message.segmentPresenceLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.LabelAnnotation.encode(message.segmentPresenceLabelAnnotations[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.shotPresenceLabelAnnotations != null && message.shotPresenceLabelAnnotations.length) + for (var i = 0; i < message.shotPresenceLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1.LabelAnnotation.encode(message.shotPresenceLabelAnnotations[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decode = function 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.videointelligence.v1.VideoAnnotationResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 10: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.segmentLabelAnnotations && message.segmentLabelAnnotations.length)) + message.segmentLabelAnnotations = []; + message.segmentLabelAnnotations.push($root.google.cloud.videointelligence.v1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 23: { + if (!(message.segmentPresenceLabelAnnotations && message.segmentPresenceLabelAnnotations.length)) + message.segmentPresenceLabelAnnotations = []; + message.segmentPresenceLabelAnnotations.push($root.google.cloud.videointelligence.v1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.shotLabelAnnotations && message.shotLabelAnnotations.length)) + message.shotLabelAnnotations = []; + message.shotLabelAnnotations.push($root.google.cloud.videointelligence.v1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 24: { + if (!(message.shotPresenceLabelAnnotations && message.shotPresenceLabelAnnotations.length)) + message.shotPresenceLabelAnnotations = []; + message.shotPresenceLabelAnnotations.push($root.google.cloud.videointelligence.v1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frameLabelAnnotations && message.frameLabelAnnotations.length)) + message.frameLabelAnnotations = []; + message.frameLabelAnnotations.push($root.google.cloud.videointelligence.v1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.videointelligence.v1.FaceAnnotation.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.faceDetectionAnnotations && message.faceDetectionAnnotations.length)) + message.faceDetectionAnnotations = []; + message.faceDetectionAnnotations.push($root.google.cloud.videointelligence.v1.FaceDetectionAnnotation.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.shotAnnotations && message.shotAnnotations.length)) + message.shotAnnotations = []; + message.shotAnnotations.push($root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.explicitAnnotation = $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.speechTranscriptions && message.speechTranscriptions.length)) + message.speechTranscriptions = []; + message.speechTranscriptions.push($root.google.cloud.videointelligence.v1.SpeechTranscription.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.videointelligence.v1.TextAnnotation.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.objectAnnotations && message.objectAnnotations.length)) + message.objectAnnotations = []; + message.objectAnnotations.push($root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation.decode(reader, reader.uint32())); + break; + } + case 19: { + if (!(message.logoRecognitionAnnotations && message.logoRecognitionAnnotations.length)) + message.logoRecognitionAnnotations = []; + message.logoRecognitionAnnotations.push($root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.personDetectionAnnotations && message.personDetectionAnnotations.length)) + message.personDetectionAnnotations = []; + message.personDetectionAnnotations.push($root.google.cloud.videointelligence.v1.PersonDetectionAnnotation.decode(reader, reader.uint32())); + break; + } + case 9: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationResults message. + * @function verify + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.segmentLabelAnnotations != null && message.hasOwnProperty("segmentLabelAnnotations")) { + if (!Array.isArray(message.segmentLabelAnnotations)) + return "segmentLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelAnnotation.verify(message.segmentLabelAnnotations[i]); + if (error) + return "segmentLabelAnnotations." + error; + } + } + if (message.segmentPresenceLabelAnnotations != null && message.hasOwnProperty("segmentPresenceLabelAnnotations")) { + if (!Array.isArray(message.segmentPresenceLabelAnnotations)) + return "segmentPresenceLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentPresenceLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelAnnotation.verify(message.segmentPresenceLabelAnnotations[i]); + if (error) + return "segmentPresenceLabelAnnotations." + error; + } + } + if (message.shotLabelAnnotations != null && message.hasOwnProperty("shotLabelAnnotations")) { + if (!Array.isArray(message.shotLabelAnnotations)) + return "shotLabelAnnotations: array expected"; + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelAnnotation.verify(message.shotLabelAnnotations[i]); + if (error) + return "shotLabelAnnotations." + error; + } + } + if (message.shotPresenceLabelAnnotations != null && message.hasOwnProperty("shotPresenceLabelAnnotations")) { + if (!Array.isArray(message.shotPresenceLabelAnnotations)) + return "shotPresenceLabelAnnotations: array expected"; + for (var i = 0; i < message.shotPresenceLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelAnnotation.verify(message.shotPresenceLabelAnnotations[i]); + if (error) + return "shotPresenceLabelAnnotations." + error; + } + } + if (message.frameLabelAnnotations != null && message.hasOwnProperty("frameLabelAnnotations")) { + if (!Array.isArray(message.frameLabelAnnotations)) + return "frameLabelAnnotations: array expected"; + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LabelAnnotation.verify(message.frameLabelAnnotations[i]); + if (error) + return "frameLabelAnnotations." + error; + } + } + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.faceDetectionAnnotations != null && message.hasOwnProperty("faceDetectionAnnotations")) { + if (!Array.isArray(message.faceDetectionAnnotations)) + return "faceDetectionAnnotations: array expected"; + for (var i = 0; i < message.faceDetectionAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.FaceDetectionAnnotation.verify(message.faceDetectionAnnotations[i]); + if (error) + return "faceDetectionAnnotations." + error; + } + } + if (message.shotAnnotations != null && message.hasOwnProperty("shotAnnotations")) { + if (!Array.isArray(message.shotAnnotations)) + return "shotAnnotations: array expected"; + for (var i = 0; i < message.shotAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.shotAnnotations[i]); + if (error) + return "shotAnnotations." + error; + } + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) { + var error = $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation.verify(message.explicitAnnotation); + if (error) + return "explicitAnnotation." + error; + } + if (message.speechTranscriptions != null && message.hasOwnProperty("speechTranscriptions")) { + if (!Array.isArray(message.speechTranscriptions)) + return "speechTranscriptions: array expected"; + for (var i = 0; i < message.speechTranscriptions.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.SpeechTranscription.verify(message.speechTranscriptions[i]); + if (error) + return "speechTranscriptions." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.TextAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.objectAnnotations != null && message.hasOwnProperty("objectAnnotations")) { + if (!Array.isArray(message.objectAnnotations)) + return "objectAnnotations: array expected"; + for (var i = 0; i < message.objectAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation.verify(message.objectAnnotations[i]); + if (error) + return "objectAnnotations." + error; + } + } + if (message.logoRecognitionAnnotations != null && message.hasOwnProperty("logoRecognitionAnnotations")) { + if (!Array.isArray(message.logoRecognitionAnnotations)) + return "logoRecognitionAnnotations: array expected"; + for (var i = 0; i < message.logoRecognitionAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation.verify(message.logoRecognitionAnnotations[i]); + if (error) + return "logoRecognitionAnnotations." + error; + } + } + if (message.personDetectionAnnotations != null && message.hasOwnProperty("personDetectionAnnotations")) { + if (!Array.isArray(message.personDetectionAnnotations)) + return "personDetectionAnnotations: array expected"; + for (var i = 0; i < message.personDetectionAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.PersonDetectionAnnotation.verify(message.personDetectionAnnotations[i]); + if (error) + return "personDetectionAnnotations." + error; + } + } + 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 VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.VideoAnnotationResults} VideoAnnotationResults + */ + VideoAnnotationResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.VideoAnnotationResults) + return object; + var message = new $root.google.cloud.videointelligence.v1.VideoAnnotationResults(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + if (object.segmentLabelAnnotations) { + if (!Array.isArray(object.segmentLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.segmentLabelAnnotations: array expected"); + message.segmentLabelAnnotations = []; + for (var i = 0; i < object.segmentLabelAnnotations.length; ++i) { + if (typeof object.segmentLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.segmentLabelAnnotations: object expected"); + message.segmentLabelAnnotations[i] = $root.google.cloud.videointelligence.v1.LabelAnnotation.fromObject(object.segmentLabelAnnotations[i]); + } + } + if (object.segmentPresenceLabelAnnotations) { + if (!Array.isArray(object.segmentPresenceLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.segmentPresenceLabelAnnotations: array expected"); + message.segmentPresenceLabelAnnotations = []; + for (var i = 0; i < object.segmentPresenceLabelAnnotations.length; ++i) { + if (typeof object.segmentPresenceLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.segmentPresenceLabelAnnotations: object expected"); + message.segmentPresenceLabelAnnotations[i] = $root.google.cloud.videointelligence.v1.LabelAnnotation.fromObject(object.segmentPresenceLabelAnnotations[i]); + } + } + if (object.shotLabelAnnotations) { + if (!Array.isArray(object.shotLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.shotLabelAnnotations: array expected"); + message.shotLabelAnnotations = []; + for (var i = 0; i < object.shotLabelAnnotations.length; ++i) { + if (typeof object.shotLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.shotLabelAnnotations: object expected"); + message.shotLabelAnnotations[i] = $root.google.cloud.videointelligence.v1.LabelAnnotation.fromObject(object.shotLabelAnnotations[i]); + } + } + if (object.shotPresenceLabelAnnotations) { + if (!Array.isArray(object.shotPresenceLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.shotPresenceLabelAnnotations: array expected"); + message.shotPresenceLabelAnnotations = []; + for (var i = 0; i < object.shotPresenceLabelAnnotations.length; ++i) { + if (typeof object.shotPresenceLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.shotPresenceLabelAnnotations: object expected"); + message.shotPresenceLabelAnnotations[i] = $root.google.cloud.videointelligence.v1.LabelAnnotation.fromObject(object.shotPresenceLabelAnnotations[i]); + } + } + if (object.frameLabelAnnotations) { + if (!Array.isArray(object.frameLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.frameLabelAnnotations: array expected"); + message.frameLabelAnnotations = []; + for (var i = 0; i < object.frameLabelAnnotations.length; ++i) { + if (typeof object.frameLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.frameLabelAnnotations: object expected"); + message.frameLabelAnnotations[i] = $root.google.cloud.videointelligence.v1.LabelAnnotation.fromObject(object.frameLabelAnnotations[i]); + } + } + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.videointelligence.v1.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.faceDetectionAnnotations) { + if (!Array.isArray(object.faceDetectionAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.faceDetectionAnnotations: array expected"); + message.faceDetectionAnnotations = []; + for (var i = 0; i < object.faceDetectionAnnotations.length; ++i) { + if (typeof object.faceDetectionAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.faceDetectionAnnotations: object expected"); + message.faceDetectionAnnotations[i] = $root.google.cloud.videointelligence.v1.FaceDetectionAnnotation.fromObject(object.faceDetectionAnnotations[i]); + } + } + if (object.shotAnnotations) { + if (!Array.isArray(object.shotAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.shotAnnotations: array expected"); + message.shotAnnotations = []; + for (var i = 0; i < object.shotAnnotations.length; ++i) { + if (typeof object.shotAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.shotAnnotations: object expected"); + message.shotAnnotations[i] = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.shotAnnotations[i]); + } + } + if (object.explicitAnnotation != null) { + if (typeof object.explicitAnnotation !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.explicitAnnotation: object expected"); + message.explicitAnnotation = $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation.fromObject(object.explicitAnnotation); + } + if (object.speechTranscriptions) { + if (!Array.isArray(object.speechTranscriptions)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.speechTranscriptions: array expected"); + message.speechTranscriptions = []; + for (var i = 0; i < object.speechTranscriptions.length; ++i) { + if (typeof object.speechTranscriptions[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.speechTranscriptions: object expected"); + message.speechTranscriptions[i] = $root.google.cloud.videointelligence.v1.SpeechTranscription.fromObject(object.speechTranscriptions[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.videointelligence.v1.TextAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.objectAnnotations) { + if (!Array.isArray(object.objectAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.objectAnnotations: array expected"); + message.objectAnnotations = []; + for (var i = 0; i < object.objectAnnotations.length; ++i) { + if (typeof object.objectAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.objectAnnotations: object expected"); + message.objectAnnotations[i] = $root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation.fromObject(object.objectAnnotations[i]); + } + } + if (object.logoRecognitionAnnotations) { + if (!Array.isArray(object.logoRecognitionAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.logoRecognitionAnnotations: array expected"); + message.logoRecognitionAnnotations = []; + for (var i = 0; i < object.logoRecognitionAnnotations.length; ++i) { + if (typeof object.logoRecognitionAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.logoRecognitionAnnotations: object expected"); + message.logoRecognitionAnnotations[i] = $root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation.fromObject(object.logoRecognitionAnnotations[i]); + } + } + if (object.personDetectionAnnotations) { + if (!Array.isArray(object.personDetectionAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.personDetectionAnnotations: array expected"); + message.personDetectionAnnotations = []; + for (var i = 0; i < object.personDetectionAnnotations.length; ++i) { + if (typeof object.personDetectionAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.personDetectionAnnotations: object expected"); + message.personDetectionAnnotations[i] = $root.google.cloud.videointelligence.v1.PersonDetectionAnnotation.fromObject(object.personDetectionAnnotations[i]); + } + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationResults.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1.VideoAnnotationResults} message VideoAnnotationResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segmentLabelAnnotations = []; + object.shotLabelAnnotations = []; + object.frameLabelAnnotations = []; + object.faceAnnotations = []; + object.shotAnnotations = []; + object.speechTranscriptions = []; + object.textAnnotations = []; + object.faceDetectionAnnotations = []; + object.objectAnnotations = []; + object.logoRecognitionAnnotations = []; + object.personDetectionAnnotations = []; + object.segmentPresenceLabelAnnotations = []; + object.shotPresenceLabelAnnotations = []; + } + if (options.defaults) { + object.inputUri = ""; + object.explicitAnnotation = null; + object.error = null; + object.segment = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.segmentLabelAnnotations && message.segmentLabelAnnotations.length) { + object.segmentLabelAnnotations = []; + for (var j = 0; j < message.segmentLabelAnnotations.length; ++j) + object.segmentLabelAnnotations[j] = $root.google.cloud.videointelligence.v1.LabelAnnotation.toObject(message.segmentLabelAnnotations[j], options); + } + if (message.shotLabelAnnotations && message.shotLabelAnnotations.length) { + object.shotLabelAnnotations = []; + for (var j = 0; j < message.shotLabelAnnotations.length; ++j) + object.shotLabelAnnotations[j] = $root.google.cloud.videointelligence.v1.LabelAnnotation.toObject(message.shotLabelAnnotations[j], options); + } + if (message.frameLabelAnnotations && message.frameLabelAnnotations.length) { + object.frameLabelAnnotations = []; + for (var j = 0; j < message.frameLabelAnnotations.length; ++j) + object.frameLabelAnnotations[j] = $root.google.cloud.videointelligence.v1.LabelAnnotation.toObject(message.frameLabelAnnotations[j], options); + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.videointelligence.v1.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.shotAnnotations && message.shotAnnotations.length) { + object.shotAnnotations = []; + for (var j = 0; j < message.shotAnnotations.length; ++j) + object.shotAnnotations[j] = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.shotAnnotations[j], options); + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) + object.explicitAnnotation = $root.google.cloud.videointelligence.v1.ExplicitContentAnnotation.toObject(message.explicitAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + if (message.speechTranscriptions && message.speechTranscriptions.length) { + object.speechTranscriptions = []; + for (var j = 0; j < message.speechTranscriptions.length; ++j) + object.speechTranscriptions[j] = $root.google.cloud.videointelligence.v1.SpeechTranscription.toObject(message.speechTranscriptions[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.videointelligence.v1.TextAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.faceDetectionAnnotations && message.faceDetectionAnnotations.length) { + object.faceDetectionAnnotations = []; + for (var j = 0; j < message.faceDetectionAnnotations.length; ++j) + object.faceDetectionAnnotations[j] = $root.google.cloud.videointelligence.v1.FaceDetectionAnnotation.toObject(message.faceDetectionAnnotations[j], options); + } + if (message.objectAnnotations && message.objectAnnotations.length) { + object.objectAnnotations = []; + for (var j = 0; j < message.objectAnnotations.length; ++j) + object.objectAnnotations[j] = $root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation.toObject(message.objectAnnotations[j], options); + } + if (message.logoRecognitionAnnotations && message.logoRecognitionAnnotations.length) { + object.logoRecognitionAnnotations = []; + for (var j = 0; j < message.logoRecognitionAnnotations.length; ++j) + object.logoRecognitionAnnotations[j] = $root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation.toObject(message.logoRecognitionAnnotations[j], options); + } + if (message.personDetectionAnnotations && message.personDetectionAnnotations.length) { + object.personDetectionAnnotations = []; + for (var j = 0; j < message.personDetectionAnnotations.length; ++j) + object.personDetectionAnnotations[j] = $root.google.cloud.videointelligence.v1.PersonDetectionAnnotation.toObject(message.personDetectionAnnotations[j], options); + } + if (message.segmentPresenceLabelAnnotations && message.segmentPresenceLabelAnnotations.length) { + object.segmentPresenceLabelAnnotations = []; + for (var j = 0; j < message.segmentPresenceLabelAnnotations.length; ++j) + object.segmentPresenceLabelAnnotations[j] = $root.google.cloud.videointelligence.v1.LabelAnnotation.toObject(message.segmentPresenceLabelAnnotations[j], options); + } + if (message.shotPresenceLabelAnnotations && message.shotPresenceLabelAnnotations.length) { + object.shotPresenceLabelAnnotations = []; + for (var j = 0; j < message.shotPresenceLabelAnnotations.length; ++j) + object.shotPresenceLabelAnnotations[j] = $root.google.cloud.videointelligence.v1.LabelAnnotation.toObject(message.shotPresenceLabelAnnotations[j], options); + } + return object; + }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationResults + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.VideoAnnotationResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.VideoAnnotationResults"; + }; + + return VideoAnnotationResults; + })(); + + v1.AnnotateVideoResponse = (function() { + + /** + * Properties of an AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1 + * @interface IAnnotateVideoResponse + * @property {Array.|null} [annotationResults] AnnotateVideoResponse annotationResults + */ + + /** + * Constructs a new AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an AnnotateVideoResponse. + * @implements IAnnotateVideoResponse + * @constructor + * @param {google.cloud.videointelligence.v1.IAnnotateVideoResponse=} [properties] Properties to set + */ + function AnnotateVideoResponse(properties) { + this.annotationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoResponse annotationResults. + * @member {Array.} annotationResults + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @instance + */ + AnnotateVideoResponse.prototype.annotationResults = $util.emptyArray; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoResponse=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.AnnotateVideoResponse} AnnotateVideoResponse instance + */ + AnnotateVideoResponse.create = function create(properties) { + return new AnnotateVideoResponse(properties); + }; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationResults != null && message.annotationResults.length) + for (var i = 0; i < message.annotationResults.length; ++i) + $root.google.cloud.videointelligence.v1.VideoAnnotationResults.encode(message.annotationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decode = function 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.videointelligence.v1.AnnotateVideoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationResults && message.annotationResults.length)) + message.annotationResults = []; + message.annotationResults.push($root.google.cloud.videointelligence.v1.VideoAnnotationResults.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoResponse message. + * @function verify + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) { + if (!Array.isArray(message.annotationResults)) + return "annotationResults: array expected"; + for (var i = 0; i < message.annotationResults.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.VideoAnnotationResults.verify(message.annotationResults[i]); + if (error) + return "annotationResults." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.AnnotateVideoResponse} AnnotateVideoResponse + */ + AnnotateVideoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.AnnotateVideoResponse) + return object; + var message = new $root.google.cloud.videointelligence.v1.AnnotateVideoResponse(); + if (object.annotationResults) { + if (!Array.isArray(object.annotationResults)) + throw TypeError(".google.cloud.videointelligence.v1.AnnotateVideoResponse.annotationResults: array expected"); + message.annotationResults = []; + for (var i = 0; i < object.annotationResults.length; ++i) { + if (typeof object.annotationResults[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.AnnotateVideoResponse.annotationResults: object expected"); + message.annotationResults[i] = $root.google.cloud.videointelligence.v1.VideoAnnotationResults.fromObject(object.annotationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1.AnnotateVideoResponse} message AnnotateVideoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationResults = []; + if (message.annotationResults && message.annotationResults.length) { + object.annotationResults = []; + for (var j = 0; j < message.annotationResults.length; ++j) + object.annotationResults[j] = $root.google.cloud.videointelligence.v1.VideoAnnotationResults.toObject(message.annotationResults[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.AnnotateVideoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.AnnotateVideoResponse"; + }; + + return AnnotateVideoResponse; + })(); + + v1.VideoAnnotationProgress = (function() { + + /** + * Properties of a VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1 + * @interface IVideoAnnotationProgress + * @property {string|null} [inputUri] VideoAnnotationProgress inputUri + * @property {number|null} [progressPercent] VideoAnnotationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] VideoAnnotationProgress startTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VideoAnnotationProgress updateTime + * @property {google.cloud.videointelligence.v1.Feature|null} [feature] VideoAnnotationProgress feature + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] VideoAnnotationProgress segment + */ + + /** + * Constructs a new VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a VideoAnnotationProgress. + * @implements IVideoAnnotationProgress + * @constructor + * @param {google.cloud.videointelligence.v1.IVideoAnnotationProgress=} [properties] Properties to set + */ + function VideoAnnotationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationProgress inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.inputUri = ""; + + /** + * VideoAnnotationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.progressPercent = 0; + + /** + * VideoAnnotationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.startTime = null; + + /** + * VideoAnnotationProgress updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.updateTime = null; + + /** + * VideoAnnotationProgress feature. + * @member {google.cloud.videointelligence.v1.Feature} feature + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.feature = 0; + + /** + * VideoAnnotationProgress segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.segment = null; + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1.IVideoAnnotationProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.VideoAnnotationProgress} VideoAnnotationProgress instance + */ + VideoAnnotationProgress.create = function create(properties) { + return new VideoAnnotationProgress(properties); + }; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.feature); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.VideoAnnotationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decode = function 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.videointelligence.v1.VideoAnnotationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.progressPercent = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.feature = reader.int32(); + break; + } + case 6: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.feature != null && message.hasOwnProperty("feature")) + switch (message.feature) { + default: + return "feature: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 9: + case 12: + case 14: + break; + } + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + return null; + }; + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.VideoAnnotationProgress} VideoAnnotationProgress + */ + VideoAnnotationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.VideoAnnotationProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1.VideoAnnotationProgress(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationProgress.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.feature) { + default: + if (typeof object.feature === "number") { + message.feature = object.feature; + break; + } + break; + case "FEATURE_UNSPECIFIED": + case 0: + message.feature = 0; + break; + case "LABEL_DETECTION": + case 1: + message.feature = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.feature = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.feature = 3; + break; + case "FACE_DETECTION": + case 4: + message.feature = 4; + break; + case "SPEECH_TRANSCRIPTION": + case 6: + message.feature = 6; + break; + case "TEXT_DETECTION": + case 7: + message.feature = 7; + break; + case "OBJECT_TRACKING": + case 9: + message.feature = 9; + break; + case "LOGO_RECOGNITION": + case 12: + message.feature = 12; + break; + case "PERSON_DETECTION": + case 14: + message.feature = 14; + break; + } + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.VideoAnnotationProgress.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1.VideoAnnotationProgress} message VideoAnnotationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.progressPercent = 0; + object.startTime = null; + object.updateTime = null; + object.feature = options.enums === String ? "FEATURE_UNSPECIFIED" : 0; + object.segment = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = options.enums === String ? $root.google.cloud.videointelligence.v1.Feature[message.feature] === undefined ? message.feature : $root.google.cloud.videointelligence.v1.Feature[message.feature] : message.feature; + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + return object; + }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.VideoAnnotationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.VideoAnnotationProgress"; + }; + + return VideoAnnotationProgress; + })(); + + v1.AnnotateVideoProgress = (function() { + + /** + * Properties of an AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1 + * @interface IAnnotateVideoProgress + * @property {Array.|null} [annotationProgress] AnnotateVideoProgress annotationProgress + */ + + /** + * Constructs a new AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an AnnotateVideoProgress. + * @implements IAnnotateVideoProgress + * @constructor + * @param {google.cloud.videointelligence.v1.IAnnotateVideoProgress=} [properties] Properties to set + */ + function AnnotateVideoProgress(properties) { + this.annotationProgress = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoProgress annotationProgress. + * @member {Array.} annotationProgress + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @instance + */ + AnnotateVideoProgress.prototype.annotationProgress = $util.emptyArray; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.AnnotateVideoProgress} AnnotateVideoProgress instance + */ + AnnotateVideoProgress.create = function create(properties) { + return new AnnotateVideoProgress(properties); + }; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationProgress != null && message.annotationProgress.length) + for (var i = 0; i < message.annotationProgress.length; ++i) + $root.google.cloud.videointelligence.v1.VideoAnnotationProgress.encode(message.annotationProgress[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.AnnotateVideoProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decode = function 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.videointelligence.v1.AnnotateVideoProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationProgress && message.annotationProgress.length)) + message.annotationProgress = []; + message.annotationProgress.push($root.google.cloud.videointelligence.v1.VideoAnnotationProgress.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationProgress != null && message.hasOwnProperty("annotationProgress")) { + if (!Array.isArray(message.annotationProgress)) + return "annotationProgress: array expected"; + for (var i = 0; i < message.annotationProgress.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.VideoAnnotationProgress.verify(message.annotationProgress[i]); + if (error) + return "annotationProgress." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.AnnotateVideoProgress} AnnotateVideoProgress + */ + AnnotateVideoProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.AnnotateVideoProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1.AnnotateVideoProgress(); + if (object.annotationProgress) { + if (!Array.isArray(object.annotationProgress)) + throw TypeError(".google.cloud.videointelligence.v1.AnnotateVideoProgress.annotationProgress: array expected"); + message.annotationProgress = []; + for (var i = 0; i < object.annotationProgress.length; ++i) { + if (typeof object.annotationProgress[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.AnnotateVideoProgress.annotationProgress: object expected"); + message.annotationProgress[i] = $root.google.cloud.videointelligence.v1.VideoAnnotationProgress.fromObject(object.annotationProgress[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1.AnnotateVideoProgress} message AnnotateVideoProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationProgress = []; + if (message.annotationProgress && message.annotationProgress.length) { + object.annotationProgress = []; + for (var j = 0; j < message.annotationProgress.length; ++j) + object.annotationProgress[j] = $root.google.cloud.videointelligence.v1.VideoAnnotationProgress.toObject(message.annotationProgress[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.AnnotateVideoProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.AnnotateVideoProgress"; + }; + + return AnnotateVideoProgress; + })(); + + v1.SpeechTranscriptionConfig = (function() { + + /** + * Properties of a SpeechTranscriptionConfig. + * @memberof google.cloud.videointelligence.v1 + * @interface ISpeechTranscriptionConfig + * @property {string|null} [languageCode] SpeechTranscriptionConfig languageCode + * @property {number|null} [maxAlternatives] SpeechTranscriptionConfig maxAlternatives + * @property {boolean|null} [filterProfanity] SpeechTranscriptionConfig filterProfanity + * @property {Array.|null} [speechContexts] SpeechTranscriptionConfig speechContexts + * @property {boolean|null} [enableAutomaticPunctuation] SpeechTranscriptionConfig enableAutomaticPunctuation + * @property {Array.|null} [audioTracks] SpeechTranscriptionConfig audioTracks + * @property {boolean|null} [enableSpeakerDiarization] SpeechTranscriptionConfig enableSpeakerDiarization + * @property {number|null} [diarizationSpeakerCount] SpeechTranscriptionConfig diarizationSpeakerCount + * @property {boolean|null} [enableWordConfidence] SpeechTranscriptionConfig enableWordConfidence + */ + + /** + * Constructs a new SpeechTranscriptionConfig. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a SpeechTranscriptionConfig. + * @implements ISpeechTranscriptionConfig + * @constructor + * @param {google.cloud.videointelligence.v1.ISpeechTranscriptionConfig=} [properties] Properties to set + */ + function SpeechTranscriptionConfig(properties) { + this.speechContexts = []; + this.audioTracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechTranscriptionConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.languageCode = ""; + + /** + * SpeechTranscriptionConfig maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.maxAlternatives = 0; + + /** + * SpeechTranscriptionConfig filterProfanity. + * @member {boolean} filterProfanity + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.filterProfanity = false; + + /** + * SpeechTranscriptionConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.speechContexts = $util.emptyArray; + + /** + * SpeechTranscriptionConfig enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableAutomaticPunctuation = false; + + /** + * SpeechTranscriptionConfig audioTracks. + * @member {Array.} audioTracks + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.audioTracks = $util.emptyArray; + + /** + * SpeechTranscriptionConfig enableSpeakerDiarization. + * @member {boolean} enableSpeakerDiarization + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableSpeakerDiarization = false; + + /** + * SpeechTranscriptionConfig diarizationSpeakerCount. + * @member {number} diarizationSpeakerCount + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.diarizationSpeakerCount = 0; + + /** + * SpeechTranscriptionConfig enableWordConfidence. + * @member {boolean} enableWordConfidence + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableWordConfidence = false; + + /** + * Creates a new SpeechTranscriptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1.ISpeechTranscriptionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.SpeechTranscriptionConfig} SpeechTranscriptionConfig instance + */ + SpeechTranscriptionConfig.create = function create(properties) { + return new SpeechTranscriptionConfig(properties); + }; + + /** + * Encodes the specified SpeechTranscriptionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscriptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1.ISpeechTranscriptionConfig} message SpeechTranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscriptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxAlternatives); + if (message.filterProfanity != null && Object.hasOwnProperty.call(message, "filterProfanity")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.filterProfanity); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.videointelligence.v1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableAutomaticPunctuation); + if (message.audioTracks != null && message.audioTracks.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.audioTracks.length; ++i) + writer.int32(message.audioTracks[i]); + writer.ldelim(); + } + if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableSpeakerDiarization); + if (message.diarizationSpeakerCount != null && Object.hasOwnProperty.call(message, "diarizationSpeakerCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.diarizationSpeakerCount); + if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableWordConfidence); + return writer; + }; + + /** + * Encodes the specified SpeechTranscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscriptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1.ISpeechTranscriptionConfig} message SpeechTranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscriptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscriptionConfig.decode = function 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.videointelligence.v1.SpeechTranscriptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.maxAlternatives = reader.int32(); + break; + } + case 3: { + message.filterProfanity = reader.bool(); + break; + } + case 4: { + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.videointelligence.v1.SpeechContext.decode(reader, reader.uint32())); + break; + } + case 5: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 6: { + if (!(message.audioTracks && message.audioTracks.length)) + message.audioTracks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.audioTracks.push(reader.int32()); + } else + message.audioTracks.push(reader.int32()); + break; + } + case 7: { + message.enableSpeakerDiarization = reader.bool(); + break; + } + case 8: { + message.diarizationSpeakerCount = reader.int32(); + break; + } + case 9: { + message.enableWordConfidence = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscriptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechTranscriptionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechTranscriptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + if (message.filterProfanity != null && message.hasOwnProperty("filterProfanity")) + if (typeof message.filterProfanity !== "boolean") + return "filterProfanity: boolean expected"; + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.audioTracks != null && message.hasOwnProperty("audioTracks")) { + if (!Array.isArray(message.audioTracks)) + return "audioTracks: array expected"; + for (var i = 0; i < message.audioTracks.length; ++i) + if (!$util.isInteger(message.audioTracks[i])) + return "audioTracks: integer[] expected"; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + if (typeof message.enableSpeakerDiarization !== "boolean") + return "enableSpeakerDiarization: boolean expected"; + if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount")) + if (!$util.isInteger(message.diarizationSpeakerCount)) + return "diarizationSpeakerCount: integer expected"; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + if (typeof message.enableWordConfidence !== "boolean") + return "enableWordConfidence: boolean expected"; + return null; + }; + + /** + * Creates a SpeechTranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + */ + SpeechTranscriptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1.SpeechTranscriptionConfig(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + if (object.filterProfanity != null) + message.filterProfanity = Boolean(object.filterProfanity); + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.videointelligence.v1.SpeechTranscriptionConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.SpeechTranscriptionConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.videointelligence.v1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.audioTracks) { + if (!Array.isArray(object.audioTracks)) + throw TypeError(".google.cloud.videointelligence.v1.SpeechTranscriptionConfig.audioTracks: array expected"); + message.audioTracks = []; + for (var i = 0; i < object.audioTracks.length; ++i) + message.audioTracks[i] = object.audioTracks[i] | 0; + } + if (object.enableSpeakerDiarization != null) + message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization); + if (object.diarizationSpeakerCount != null) + message.diarizationSpeakerCount = object.diarizationSpeakerCount | 0; + if (object.enableWordConfidence != null) + message.enableWordConfidence = Boolean(object.enableWordConfidence); + return message; + }; + + /** + * Creates a plain object from a SpeechTranscriptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1.SpeechTranscriptionConfig} message SpeechTranscriptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechTranscriptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechContexts = []; + object.audioTracks = []; + } + if (options.defaults) { + object.languageCode = ""; + object.maxAlternatives = 0; + object.filterProfanity = false; + object.enableAutomaticPunctuation = false; + object.enableSpeakerDiarization = false; + object.diarizationSpeakerCount = 0; + object.enableWordConfidence = false; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.filterProfanity != null && message.hasOwnProperty("filterProfanity")) + object.filterProfanity = message.filterProfanity; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.videointelligence.v1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.audioTracks && message.audioTracks.length) { + object.audioTracks = []; + for (var j = 0; j < message.audioTracks.length; ++j) + object.audioTracks[j] = message.audioTracks[j]; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + object.enableSpeakerDiarization = message.enableSpeakerDiarization; + if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount")) + object.diarizationSpeakerCount = message.diarizationSpeakerCount; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + object.enableWordConfidence = message.enableWordConfidence; + return object; + }; + + /** + * Converts this SpeechTranscriptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechTranscriptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechTranscriptionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.SpeechTranscriptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechTranscriptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.SpeechTranscriptionConfig"; + }; + + return SpeechTranscriptionConfig; + })(); + + v1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.videointelligence.v1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.videointelligence.v1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function 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.videointelligence.v1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.SpeechContext) + return object; + var message = new $root.google.cloud.videointelligence.v1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.videointelligence.v1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.SpeechContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.SpeechContext"; + }; + + return SpeechContext; + })(); + + v1.SpeechTranscription = (function() { + + /** + * Properties of a SpeechTranscription. + * @memberof google.cloud.videointelligence.v1 + * @interface ISpeechTranscription + * @property {Array.|null} [alternatives] SpeechTranscription alternatives + * @property {string|null} [languageCode] SpeechTranscription languageCode + */ + + /** + * Constructs a new SpeechTranscription. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a SpeechTranscription. + * @implements ISpeechTranscription + * @constructor + * @param {google.cloud.videointelligence.v1.ISpeechTranscription=} [properties] Properties to set + */ + function SpeechTranscription(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechTranscription alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @instance + */ + SpeechTranscription.prototype.alternatives = $util.emptyArray; + + /** + * SpeechTranscription languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @instance + */ + SpeechTranscription.prototype.languageCode = ""; + + /** + * Creates a new SpeechTranscription instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1.ISpeechTranscription=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.SpeechTranscription} SpeechTranscription instance + */ + SpeechTranscription.create = function create(properties) { + return new SpeechTranscription(properties); + }; + + /** + * Encodes the specified SpeechTranscription message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscription.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1.ISpeechTranscription} message SpeechTranscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified SpeechTranscription message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechTranscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1.ISpeechTranscription} message SpeechTranscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.SpeechTranscription} SpeechTranscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscription.decode = function 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.videointelligence.v1.SpeechTranscription(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.SpeechTranscription} SpeechTranscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechTranscription message. + * @function verify + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechTranscription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a SpeechTranscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.SpeechTranscription} SpeechTranscription + */ + SpeechTranscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.SpeechTranscription) + return object; + var message = new $root.google.cloud.videointelligence.v1.SpeechTranscription(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.videointelligence.v1.SpeechTranscription.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.SpeechTranscription.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a SpeechTranscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1.SpeechTranscription} message SpeechTranscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechTranscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) + object.languageCode = ""; + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this SpeechTranscription to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @instance + * @returns {Object.} JSON object + */ + SpeechTranscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechTranscription + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.SpeechTranscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechTranscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.SpeechTranscription"; + }; + + return SpeechTranscription; + })(); + + v1.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.videointelligence.v1 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.videointelligence.v1.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.videointelligence.v1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function 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.videointelligence.v1.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.videointelligence.v1.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.videointelligence.v1.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.videointelligence.v1.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.videointelligence.v1.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.videointelligence.v1.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v1.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.videointelligence.v1 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime + * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime + * @property {string|null} [word] WordInfo word + * @property {number|null} [confidence] WordInfo confidence + * @property {number|null} [speakerTag] WordInfo speakerTag + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.videointelligence.v1.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startTime. + * @member {google.protobuf.IDuration|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1.WordInfo + * @instance + */ + WordInfo.prototype.startTime = null; + + /** + * WordInfo endTime. + * @member {google.protobuf.IDuration|null|undefined} endTime + * @memberof google.cloud.videointelligence.v1.WordInfo + * @instance + */ + WordInfo.prototype.endTime = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.videointelligence.v1.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * WordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.WordInfo + * @instance + */ + WordInfo.prototype.confidence = 0; + + /** + * WordInfo speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.videointelligence.v1.WordInfo + * @instance + */ + WordInfo.prototype.speakerTag = 0; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.videointelligence.v1.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function 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.videointelligence.v1.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Duration.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Duration.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.WordInfo) + return object; + var message = new $root.google.cloud.videointelligence.v1.WordInfo(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1.WordInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1.WordInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime); + } + if (object.word != null) + message.word = String(object.word); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.word = ""; + object.confidence = 0; + object.speakerTag = 0; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.WordInfo"; + }; + + return WordInfo; + })(); + + v1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.videointelligence.v1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.videointelligence.v1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function 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.videointelligence.v1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.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 NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.NormalizedVertex) + return object; + var message = new $root.google.cloud.videointelligence.v1.NormalizedVertex(); + 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 NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.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 NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1.NormalizedBoundingPoly = (function() { + + /** + * Properties of a NormalizedBoundingPoly. + * @memberof google.cloud.videointelligence.v1 + * @interface INormalizedBoundingPoly + * @property {Array.|null} [vertices] NormalizedBoundingPoly vertices + */ + + /** + * Constructs a new NormalizedBoundingPoly. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a NormalizedBoundingPoly. + * @implements INormalizedBoundingPoly + * @constructor + * @param {google.cloud.videointelligence.v1.INormalizedBoundingPoly=} [properties] Properties to set + */ + function NormalizedBoundingPoly(properties) { + this.vertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingPoly vertices. + * @member {Array.} vertices + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @instance + */ + NormalizedBoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1.INormalizedBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingPoly} NormalizedBoundingPoly instance + */ + NormalizedBoundingPoly.create = function create(properties) { + return new NormalizedBoundingPoly(properties); + }; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.videointelligence.v1.NormalizedVertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.NormalizedBoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decode = function 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.videointelligence.v1.NormalizedBoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.videointelligence.v1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingPoly message. + * @function verify + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.NormalizedVertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.NormalizedBoundingPoly} NormalizedBoundingPoly + */ + NormalizedBoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly) + return object; + var message = new $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.videointelligence.v1.NormalizedBoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.NormalizedBoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.videointelligence.v1.NormalizedVertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1.NormalizedBoundingPoly} message NormalizedBoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vertices = []; + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.videointelligence.v1.NormalizedVertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingPoly + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.NormalizedBoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.NormalizedBoundingPoly"; + }; + + return NormalizedBoundingPoly; + })(); + + v1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.videointelligence.v1 + * @interface ITextSegment + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] TextSegment segment + * @property {number|null} [confidence] TextSegment confidence + * @property {Array.|null} [frames] TextSegment frames + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.videointelligence.v1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.TextSegment + * @instance + */ + TextSegment.prototype.segment = null; + + /** + * TextSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.TextSegment + * @instance + */ + TextSegment.prototype.confidence = 0; + + /** + * TextSegment frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1.TextSegment + * @instance + */ + TextSegment.prototype.frames = $util.emptyArray; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.videointelligence.v1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1.TextFrame.encode(message.frames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function 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.videointelligence.v1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1.TextFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.TextFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.TextSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1.TextSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TextSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1.TextSegment.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TextSegment.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1.TextFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1.TextFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.TextSegment"; + }; + + return TextSegment; + })(); + + v1.TextFrame = (function() { + + /** + * Properties of a TextFrame. + * @memberof google.cloud.videointelligence.v1 + * @interface ITextFrame + * @property {google.cloud.videointelligence.v1.INormalizedBoundingPoly|null} [rotatedBoundingBox] TextFrame rotatedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] TextFrame timeOffset + */ + + /** + * Constructs a new TextFrame. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a TextFrame. + * @implements ITextFrame + * @constructor + * @param {google.cloud.videointelligence.v1.ITextFrame=} [properties] Properties to set + */ + function TextFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextFrame rotatedBoundingBox. + * @member {google.cloud.videointelligence.v1.INormalizedBoundingPoly|null|undefined} rotatedBoundingBox + * @memberof google.cloud.videointelligence.v1.TextFrame + * @instance + */ + TextFrame.prototype.rotatedBoundingBox = null; + + /** + * TextFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1.TextFrame + * @instance + */ + TextFrame.prototype.timeOffset = null; + + /** + * Creates a new TextFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1.ITextFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.TextFrame} TextFrame instance + */ + TextFrame.create = function create(properties) { + return new TextFrame(properties); + }; + + /** + * Encodes the specified TextFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.TextFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1.ITextFrame} message TextFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rotatedBoundingBox != null && Object.hasOwnProperty.call(message, "rotatedBoundingBox")) + $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly.encode(message.rotatedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1.ITextFrame} message TextFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.TextFrame} TextFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFrame.decode = function 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.videointelligence.v1.TextFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rotatedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.TextFrame} TextFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rotatedBoundingBox != null && message.hasOwnProperty("rotatedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly.verify(message.rotatedBoundingBox); + if (error) + return "rotatedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates a TextFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.TextFrame} TextFrame + */ + TextFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.TextFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1.TextFrame(); + if (object.rotatedBoundingBox != null) { + if (typeof object.rotatedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TextFrame.rotatedBoundingBox: object expected"); + message.rotatedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly.fromObject(object.rotatedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TextFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from a TextFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1.TextFrame} message TextFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rotatedBoundingBox = null; + object.timeOffset = null; + } + if (message.rotatedBoundingBox != null && message.hasOwnProperty("rotatedBoundingBox")) + object.rotatedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingPoly.toObject(message.rotatedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this TextFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.TextFrame + * @instance + * @returns {Object.} JSON object + */ + TextFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.TextFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.TextFrame"; + }; + + return TextFrame; + })(); + + v1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface ITextAnnotation + * @property {string|null} [text] TextAnnotation text + * @property {Array.|null} [segments] TextAnnotation segments + * @property {string|null} [version] TextAnnotation version + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * TextAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.segments = $util.emptyArray; + + /** + * TextAnnotation version. + * @member {string} version + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.version = ""; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1.TextSegment.encode(message.segments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decode = function 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.videointelligence.v1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1.TextSegment.decode(reader, reader.uint32())); + break; + } + case 3: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.TextSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.TextAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.TextAnnotation(); + if (object.text != null) + message.text = String(object.text); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1.TextAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.TextAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1.TextSegment.fromObject(object.segments[i]); + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) { + object.text = ""; + object.version = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1.TextSegment.toObject(message.segments[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.TextAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.TextAnnotation"; + }; + + return TextAnnotation; + })(); + + v1.ObjectTrackingFrame = (function() { + + /** + * Properties of an ObjectTrackingFrame. + * @memberof google.cloud.videointelligence.v1 + * @interface IObjectTrackingFrame + * @property {google.cloud.videointelligence.v1.INormalizedBoundingBox|null} [normalizedBoundingBox] ObjectTrackingFrame normalizedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] ObjectTrackingFrame timeOffset + */ + + /** + * Constructs a new ObjectTrackingFrame. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an ObjectTrackingFrame. + * @implements IObjectTrackingFrame + * @constructor + * @param {google.cloud.videointelligence.v1.IObjectTrackingFrame=} [properties] Properties to set + */ + function ObjectTrackingFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingFrame normalizedBoundingBox. + * @member {google.cloud.videointelligence.v1.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.normalizedBoundingBox = null; + + /** + * ObjectTrackingFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.timeOffset = null; + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ObjectTrackingFrame} ObjectTrackingFrame instance + */ + ObjectTrackingFrame.create = function create(properties) { + return new ObjectTrackingFrame(properties); + }; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingFrame} message ObjectTrackingFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingFrame} message ObjectTrackingFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ObjectTrackingFrame} ObjectTrackingFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingFrame.decode = function 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.videointelligence.v1.ObjectTrackingFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ObjectTrackingFrame} ObjectTrackingFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.verify(message.normalizedBoundingBox); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates an ObjectTrackingFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ObjectTrackingFrame} ObjectTrackingFrame + */ + ObjectTrackingFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ObjectTrackingFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1.ObjectTrackingFrame(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ObjectTrackingFrame.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ObjectTrackingFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1.ObjectTrackingFrame} message ObjectTrackingFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.normalizedBoundingBox = null; + object.timeOffset = null; + } + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.videointelligence.v1.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this ObjectTrackingFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ObjectTrackingFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ObjectTrackingFrame"; + }; + + return ObjectTrackingFrame; + })(); + + v1.ObjectTrackingAnnotation = (function() { + + /** + * Properties of an ObjectTrackingAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface IObjectTrackingAnnotation + * @property {google.cloud.videointelligence.v1.IVideoSegment|null} [segment] ObjectTrackingAnnotation segment + * @property {number|Long|null} [trackId] ObjectTrackingAnnotation trackId + * @property {google.cloud.videointelligence.v1.IEntity|null} [entity] ObjectTrackingAnnotation entity + * @property {number|null} [confidence] ObjectTrackingAnnotation confidence + * @property {Array.|null} [frames] ObjectTrackingAnnotation frames + * @property {string|null} [version] ObjectTrackingAnnotation version + */ + + /** + * Constructs a new ObjectTrackingAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents an ObjectTrackingAnnotation. + * @implements IObjectTrackingAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.IObjectTrackingAnnotation=} [properties] Properties to set + */ + function ObjectTrackingAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingAnnotation segment. + * @member {google.cloud.videointelligence.v1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.segment = null; + + /** + * ObjectTrackingAnnotation trackId. + * @member {number|Long|null|undefined} trackId + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.trackId = null; + + /** + * ObjectTrackingAnnotation entity. + * @member {google.cloud.videointelligence.v1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.entity = null; + + /** + * ObjectTrackingAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.confidence = 0; + + /** + * ObjectTrackingAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.frames = $util.emptyArray; + + /** + * ObjectTrackingAnnotation version. + * @member {string} version + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.version = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ObjectTrackingAnnotation trackInfo. + * @member {"segment"|"trackId"|undefined} trackInfo + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + */ + Object.defineProperty(ObjectTrackingAnnotation.prototype, "trackInfo", { + get: $util.oneOfGetter($oneOfFields = ["segment", "trackId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObjectTrackingAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.ObjectTrackingAnnotation} ObjectTrackingAnnotation instance + */ + ObjectTrackingAnnotation.create = function create(properties) { + return new ObjectTrackingAnnotation(properties); + }; + + /** + * Encodes the specified ObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingAnnotation} message ObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1.ObjectTrackingFrame.encode(message.frames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.trackId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.version); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.ObjectTrackingAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1.IObjectTrackingAnnotation} message ObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingAnnotation.decode = function 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.videointelligence.v1.ObjectTrackingAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 5: { + message.trackId = reader.int64(); + break; + } + case 1: { + message.entity = $root.google.cloud.videointelligence.v1.Entity.decode(reader, reader.uint32()); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 2: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1.ObjectTrackingFrame.decode(reader, reader.uint32())); + break; + } + case 6: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.segment != null && message.hasOwnProperty("segment")) { + properties.trackInfo = 1; + { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + } + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (properties.trackInfo === 1) + return "trackInfo: multiple values"; + properties.trackInfo = 1; + if (!$util.isInteger(message.trackId) && !(message.trackId && $util.isInteger(message.trackId.low) && $util.isInteger(message.trackId.high))) + return "trackId: integer|Long expected"; + } + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.ObjectTrackingFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates an ObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + */ + ObjectTrackingAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.ObjectTrackingAnnotation(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ObjectTrackingAnnotation.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segment); + } + if (object.trackId != null) + if ($util.Long) + (message.trackId = $util.Long.fromValue(object.trackId)).unsigned = false; + else if (typeof object.trackId === "string") + message.trackId = parseInt(object.trackId, 10); + else if (typeof object.trackId === "number") + message.trackId = object.trackId; + else if (typeof object.trackId === "object") + message.trackId = new $util.LongBits(object.trackId.low >>> 0, object.trackId.high >>> 0).toNumber(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ObjectTrackingAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1.Entity.fromObject(object.entity); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1.ObjectTrackingAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.ObjectTrackingAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1.ObjectTrackingFrame.fromObject(object.frames[i]); + } + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ObjectTrackingAnnotation} message ObjectTrackingAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) { + object.entity = null; + object.confidence = 0; + object.version = ""; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1.Entity.toObject(message.entity, options); + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1.ObjectTrackingFrame.toObject(message.frames[j], options); + } + if (message.segment != null && message.hasOwnProperty("segment")) { + object.segment = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segment, options); + if (options.oneofs) + object.trackInfo = "segment"; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (typeof message.trackId === "number") + object.trackId = options.longs === String ? String(message.trackId) : message.trackId; + else + object.trackId = options.longs === String ? $util.Long.prototype.toString.call(message.trackId) : options.longs === Number ? new $util.LongBits(message.trackId.low >>> 0, message.trackId.high >>> 0).toNumber() : message.trackId; + if (options.oneofs) + object.trackInfo = "trackId"; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this ObjectTrackingAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.ObjectTrackingAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.ObjectTrackingAnnotation"; + }; + + return ObjectTrackingAnnotation; + })(); + + v1.LogoRecognitionAnnotation = (function() { + + /** + * Properties of a LogoRecognitionAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @interface ILogoRecognitionAnnotation + * @property {google.cloud.videointelligence.v1.IEntity|null} [entity] LogoRecognitionAnnotation entity + * @property {Array.|null} [tracks] LogoRecognitionAnnotation tracks + * @property {Array.|null} [segments] LogoRecognitionAnnotation segments + */ + + /** + * Constructs a new LogoRecognitionAnnotation. + * @memberof google.cloud.videointelligence.v1 + * @classdesc Represents a LogoRecognitionAnnotation. + * @implements ILogoRecognitionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1.ILogoRecognitionAnnotation=} [properties] Properties to set + */ + function LogoRecognitionAnnotation(properties) { + this.tracks = []; + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogoRecognitionAnnotation entity. + * @member {google.cloud.videointelligence.v1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @instance + */ + LogoRecognitionAnnotation.prototype.entity = null; + + /** + * LogoRecognitionAnnotation tracks. + * @member {Array.} tracks + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @instance + */ + LogoRecognitionAnnotation.prototype.tracks = $util.emptyArray; + + /** + * LogoRecognitionAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @instance + */ + LogoRecognitionAnnotation.prototype.segments = $util.emptyArray; + + /** + * Creates a new LogoRecognitionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ILogoRecognitionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1.LogoRecognitionAnnotation} LogoRecognitionAnnotation instance + */ + LogoRecognitionAnnotation.create = function create(properties) { + return new LogoRecognitionAnnotation(properties); + }; + + /** + * Encodes the specified LogoRecognitionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1.LogoRecognitionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ILogoRecognitionAnnotation} message LogoRecognitionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogoRecognitionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tracks != null && message.tracks.length) + for (var i = 0; i < message.tracks.length; ++i) + $root.google.cloud.videointelligence.v1.Track.encode(message.tracks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1.VideoSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogoRecognitionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1.LogoRecognitionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.ILogoRecognitionAnnotation} message LogoRecognitionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogoRecognitionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1.LogoRecognitionAnnotation} LogoRecognitionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogoRecognitionAnnotation.decode = function 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.videointelligence.v1.LogoRecognitionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.tracks && message.tracks.length)) + message.tracks = []; + message.tracks.push($root.google.cloud.videointelligence.v1.Track.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1.VideoSegment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1.LogoRecognitionAnnotation} LogoRecognitionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogoRecognitionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogoRecognitionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogoRecognitionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.tracks != null && message.hasOwnProperty("tracks")) { + if (!Array.isArray(message.tracks)) + return "tracks: array expected"; + for (var i = 0; i < message.tracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.Track.verify(message.tracks[i]); + if (error) + return "tracks." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + return null; + }; + + /** + * Creates a LogoRecognitionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1.LogoRecognitionAnnotation} LogoRecognitionAnnotation + */ + LogoRecognitionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1.LogoRecognitionAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LogoRecognitionAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1.Entity.fromObject(object.entity); + } + if (object.tracks) { + if (!Array.isArray(object.tracks)) + throw TypeError(".google.cloud.videointelligence.v1.LogoRecognitionAnnotation.tracks: array expected"); + message.tracks = []; + for (var i = 0; i < object.tracks.length; ++i) { + if (typeof object.tracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LogoRecognitionAnnotation.tracks: object expected"); + message.tracks[i] = $root.google.cloud.videointelligence.v1.Track.fromObject(object.tracks[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1.LogoRecognitionAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1.LogoRecognitionAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1.VideoSegment.fromObject(object.segments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LogoRecognitionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1.LogoRecognitionAnnotation} message LogoRecognitionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogoRecognitionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tracks = []; + object.segments = []; + } + if (options.defaults) + object.entity = null; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1.Entity.toObject(message.entity, options); + if (message.tracks && message.tracks.length) { + object.tracks = []; + for (var j = 0; j < message.tracks.length; ++j) + object.tracks[j] = $root.google.cloud.videointelligence.v1.Track.toObject(message.tracks[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1.VideoSegment.toObject(message.segments[j], options); + } + return object; + }; + + /** + * Converts this LogoRecognitionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @instance + * @returns {Object.} JSON object + */ + LogoRecognitionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogoRecognitionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1.LogoRecognitionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogoRecognitionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1.LogoRecognitionAnnotation"; + }; + + return LogoRecognitionAnnotation; + })(); + + return v1; + })(); + + videointelligence.v1beta2 = (function() { + + /** + * Namespace v1beta2. + * @memberof google.cloud.videointelligence + * @namespace + */ + var v1beta2 = {}; + + v1beta2.VideoIntelligenceService = (function() { + + /** + * Constructs a new VideoIntelligenceService service. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a VideoIntelligenceService + * @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 VideoIntelligenceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VideoIntelligenceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoIntelligenceService; + + /** + * Creates new VideoIntelligenceService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.VideoIntelligenceService + * @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 {VideoIntelligenceService} RPC service. Useful where requests and/or responses are streamed. + */ + VideoIntelligenceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.videointelligence.v1beta2.VideoIntelligenceService|annotateVideo}. + * @memberof google.cloud.videointelligence.v1beta2.VideoIntelligenceService + * @typedef AnnotateVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1beta2.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @param {google.cloud.videointelligence.v1beta2.VideoIntelligenceService.AnnotateVideoCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoIntelligenceService.prototype.annotateVideo = function annotateVideo(request, callback) { + return this.rpcCall(annotateVideo, $root.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnnotateVideo" }); + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1beta2.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VideoIntelligenceService; + })(); + + v1beta2.AnnotateVideoRequest = (function() { + + /** + * Properties of an AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IAnnotateVideoRequest + * @property {string|null} [inputUri] AnnotateVideoRequest inputUri + * @property {Uint8Array|null} [inputContent] AnnotateVideoRequest inputContent + * @property {Array.|null} [features] AnnotateVideoRequest features + * @property {google.cloud.videointelligence.v1beta2.IVideoContext|null} [videoContext] AnnotateVideoRequest videoContext + * @property {string|null} [outputUri] AnnotateVideoRequest outputUri + * @property {string|null} [locationId] AnnotateVideoRequest locationId + */ + + /** + * Constructs a new AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an AnnotateVideoRequest. + * @implements IAnnotateVideoRequest + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest=} [properties] Properties to set + */ + function AnnotateVideoRequest(properties) { + this.features = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoRequest inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputUri = ""; + + /** + * AnnotateVideoRequest inputContent. + * @member {Uint8Array} inputContent + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputContent = $util.newBuffer([]); + + /** + * AnnotateVideoRequest features. + * @member {Array.} features + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateVideoRequest videoContext. + * @member {google.cloud.videointelligence.v1beta2.IVideoContext|null|undefined} videoContext + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.videoContext = null; + + /** + * AnnotateVideoRequest outputUri. + * @member {string} outputUri + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.outputUri = ""; + + /** + * AnnotateVideoRequest locationId. + * @member {string} locationId + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.locationId = ""; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoRequest} AnnotateVideoRequest instance + */ + AnnotateVideoRequest.create = function create(properties) { + return new AnnotateVideoRequest(properties); + }; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.features != null && message.features.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.features.length; ++i) + writer.int32(message.features[i]); + writer.ldelim(); + } + if (message.videoContext != null && Object.hasOwnProperty.call(message, "videoContext")) + $root.google.cloud.videointelligence.v1beta2.VideoContext.encode(message.videoContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUri); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + if (message.inputContent != null && Object.hasOwnProperty.call(message, "inputContent")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputContent); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decode = function 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.videointelligence.v1beta2.AnnotateVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 6: { + message.inputContent = reader.bytes(); + break; + } + case 2: { + if (!(message.features && message.features.length)) + message.features = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.features.push(reader.int32()); + } else + message.features.push(reader.int32()); + break; + } + case 3: { + message.videoContext = $root.google.cloud.videointelligence.v1beta2.VideoContext.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputUri = reader.string(); + break; + } + case 5: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoRequest message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + if (!(message.inputContent && typeof message.inputContent.length === "number" || $util.isString(message.inputContent))) + return "inputContent: buffer expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + switch (message.features[i]) { + default: + return "features: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoContext.verify(message.videoContext); + if (error) + return "videoContext." + error; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates an AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoRequest} AnnotateVideoRequest + */ + AnnotateVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.inputContent != null) + if (typeof object.inputContent === "string") + $util.base64.decode(object.inputContent, message.inputContent = $util.newBuffer($util.base64.length(object.inputContent)), 0); + else if (object.inputContent.length >= 0) + message.inputContent = object.inputContent; + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + switch (object.features[i]) { + default: + if (typeof object.features[i] === "number") { + message.features[i] = object.features[i]; + break; + } + case "FEATURE_UNSPECIFIED": + case 0: + message.features[i] = 0; + break; + case "LABEL_DETECTION": + case 1: + message.features[i] = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.features[i] = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.features[i] = 3; + break; + case "FACE_DETECTION": + case 4: + message.features[i] = 4; + break; + } + } + if (object.videoContext != null) { + if (typeof object.videoContext !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.videoContext: object expected"); + message.videoContext = $root.google.cloud.videointelligence.v1beta2.VideoContext.fromObject(object.videoContext); + } + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1beta2.AnnotateVideoRequest} message AnnotateVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputUri = ""; + object.videoContext = null; + object.outputUri = ""; + object.locationId = ""; + if (options.bytes === String) + object.inputContent = ""; + else { + object.inputContent = []; + if (options.bytes !== Array) + object.inputContent = $util.newBuffer(object.inputContent); + } + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = options.enums === String ? $root.google.cloud.videointelligence.v1beta2.Feature[message.features[j]] === undefined ? message.features[j] : $root.google.cloud.videointelligence.v1beta2.Feature[message.features[j]] : message.features[j]; + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) + object.videoContext = $root.google.cloud.videointelligence.v1beta2.VideoContext.toObject(message.videoContext, options); + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + object.inputContent = options.bytes === String ? $util.base64.encode(message.inputContent, 0, message.inputContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputContent) : message.inputContent; + return object; + }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.AnnotateVideoRequest"; + }; + + return AnnotateVideoRequest; + })(); + + v1beta2.VideoContext = (function() { + + /** + * Properties of a VideoContext. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IVideoContext + * @property {Array.|null} [segments] VideoContext segments + * @property {google.cloud.videointelligence.v1beta2.ILabelDetectionConfig|null} [labelDetectionConfig] VideoContext labelDetectionConfig + * @property {google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig|null} [shotChangeDetectionConfig] VideoContext shotChangeDetectionConfig + * @property {google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig|null} [explicitContentDetectionConfig] VideoContext explicitContentDetectionConfig + * @property {google.cloud.videointelligence.v1beta2.IFaceDetectionConfig|null} [faceDetectionConfig] VideoContext faceDetectionConfig + */ + + /** + * Constructs a new VideoContext. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a VideoContext. + * @implements IVideoContext + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IVideoContext=} [properties] Properties to set + */ + function VideoContext(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoContext segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @instance + */ + VideoContext.prototype.segments = $util.emptyArray; + + /** + * VideoContext labelDetectionConfig. + * @member {google.cloud.videointelligence.v1beta2.ILabelDetectionConfig|null|undefined} labelDetectionConfig + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @instance + */ + VideoContext.prototype.labelDetectionConfig = null; + + /** + * VideoContext shotChangeDetectionConfig. + * @member {google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig|null|undefined} shotChangeDetectionConfig + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @instance + */ + VideoContext.prototype.shotChangeDetectionConfig = null; + + /** + * VideoContext explicitContentDetectionConfig. + * @member {google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig|null|undefined} explicitContentDetectionConfig + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @instance + */ + VideoContext.prototype.explicitContentDetectionConfig = null; + + /** + * VideoContext faceDetectionConfig. + * @member {google.cloud.videointelligence.v1beta2.IFaceDetectionConfig|null|undefined} faceDetectionConfig + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @instance + */ + VideoContext.prototype.faceDetectionConfig = null; + + /** + * Creates a new VideoContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.VideoContext} VideoContext instance + */ + VideoContext.create = function create(properties) { + return new VideoContext(properties); + }; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1beta2.VideoSegment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labelDetectionConfig != null && Object.hasOwnProperty.call(message, "labelDetectionConfig")) + $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.encode(message.labelDetectionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotChangeDetectionConfig != null && Object.hasOwnProperty.call(message, "shotChangeDetectionConfig")) + $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.encode(message.shotChangeDetectionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explicitContentDetectionConfig != null && Object.hasOwnProperty.call(message, "explicitContentDetectionConfig")) + $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.encode(message.explicitContentDetectionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.faceDetectionConfig != null && Object.hasOwnProperty.call(message, "faceDetectionConfig")) + $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.encode(message.faceDetectionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decode = function 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.videointelligence.v1beta2.VideoContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1beta2.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.faceDetectionConfig = $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.verify(message.labelDetectionConfig); + if (error) + return "labelDetectionConfig." + error; + } + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.verify(message.shotChangeDetectionConfig); + if (error) + return "shotChangeDetectionConfig." + error; + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.verify(message.explicitContentDetectionConfig); + if (error) + return "explicitContentDetectionConfig." + error; + } + if (message.faceDetectionConfig != null && message.hasOwnProperty("faceDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.verify(message.faceDetectionConfig); + if (error) + return "faceDetectionConfig." + error; + } + return null; + }; + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.VideoContext} VideoContext + */ + VideoContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.VideoContext) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.VideoContext(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoContext.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoContext.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1beta2.VideoSegment.fromObject(object.segments[i]); + } + } + if (object.labelDetectionConfig != null) { + if (typeof object.labelDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoContext.labelDetectionConfig: object expected"); + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.fromObject(object.labelDetectionConfig); + } + if (object.shotChangeDetectionConfig != null) { + if (typeof object.shotChangeDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoContext.shotChangeDetectionConfig: object expected"); + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.fromObject(object.shotChangeDetectionConfig); + } + if (object.explicitContentDetectionConfig != null) { + if (typeof object.explicitContentDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoContext.explicitContentDetectionConfig: object expected"); + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.fromObject(object.explicitContentDetectionConfig); + } + if (object.faceDetectionConfig != null) { + if (typeof object.faceDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoContext.faceDetectionConfig: object expected"); + message.faceDetectionConfig = $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.fromObject(object.faceDetectionConfig); + } + return message; + }; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {google.cloud.videointelligence.v1beta2.VideoContext} message VideoContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) { + object.labelDetectionConfig = null; + object.shotChangeDetectionConfig = null; + object.explicitContentDetectionConfig = null; + object.faceDetectionConfig = null; + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1beta2.VideoSegment.toObject(message.segments[j], options); + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) + object.labelDetectionConfig = $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig.toObject(message.labelDetectionConfig, options); + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) + object.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.toObject(message.shotChangeDetectionConfig, options); + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) + object.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.toObject(message.explicitContentDetectionConfig, options); + if (message.faceDetectionConfig != null && message.hasOwnProperty("faceDetectionConfig")) + object.faceDetectionConfig = $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig.toObject(message.faceDetectionConfig, options); + return object; + }; + + /** + * Converts this VideoContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @instance + * @returns {Object.} JSON object + */ + VideoContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.VideoContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.VideoContext"; + }; + + return VideoContext; + })(); + + v1beta2.LabelDetectionConfig = (function() { + + /** + * Properties of a LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface ILabelDetectionConfig + * @property {google.cloud.videointelligence.v1beta2.LabelDetectionMode|null} [labelDetectionMode] LabelDetectionConfig labelDetectionMode + * @property {boolean|null} [stationaryCamera] LabelDetectionConfig stationaryCamera + * @property {string|null} [model] LabelDetectionConfig model + */ + + /** + * Constructs a new LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a LabelDetectionConfig. + * @implements ILabelDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1beta2.ILabelDetectionConfig=} [properties] Properties to set + */ + function LabelDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelDetectionConfig labelDetectionMode. + * @member {google.cloud.videointelligence.v1beta2.LabelDetectionMode} labelDetectionMode + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.labelDetectionMode = 0; + + /** + * LabelDetectionConfig stationaryCamera. + * @member {boolean} stationaryCamera + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.stationaryCamera = false; + + /** + * LabelDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.model = ""; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.LabelDetectionConfig} LabelDetectionConfig instance + */ + LabelDetectionConfig.create = function create(properties) { + return new LabelDetectionConfig(properties); + }; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelDetectionMode != null && Object.hasOwnProperty.call(message, "labelDetectionMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelDetectionMode); + if (message.stationaryCamera != null && Object.hasOwnProperty.call(message, "stationaryCamera")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.stationaryCamera); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decode = function 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.videointelligence.v1beta2.LabelDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelDetectionMode = reader.int32(); + break; + } + case 2: { + message.stationaryCamera = reader.bool(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + switch (message.labelDetectionMode) { + default: + return "labelDetectionMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + if (typeof message.stationaryCamera !== "boolean") + return "stationaryCamera: boolean expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.LabelDetectionConfig} LabelDetectionConfig + */ + LabelDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.LabelDetectionConfig(); + switch (object.labelDetectionMode) { + default: + if (typeof object.labelDetectionMode === "number") { + message.labelDetectionMode = object.labelDetectionMode; + break; + } + break; + case "LABEL_DETECTION_MODE_UNSPECIFIED": + case 0: + message.labelDetectionMode = 0; + break; + case "SHOT_MODE": + case 1: + message.labelDetectionMode = 1; + break; + case "FRAME_MODE": + case 2: + message.labelDetectionMode = 2; + break; + case "SHOT_AND_FRAME_MODE": + case 3: + message.labelDetectionMode = 3; + break; + } + if (object.stationaryCamera != null) + message.stationaryCamera = Boolean(object.stationaryCamera); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.LabelDetectionConfig} message LabelDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelDetectionMode = options.enums === String ? "LABEL_DETECTION_MODE_UNSPECIFIED" : 0; + object.stationaryCamera = false; + object.model = ""; + } + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + object.labelDetectionMode = options.enums === String ? $root.google.cloud.videointelligence.v1beta2.LabelDetectionMode[message.labelDetectionMode] === undefined ? message.labelDetectionMode : $root.google.cloud.videointelligence.v1beta2.LabelDetectionMode[message.labelDetectionMode] : message.labelDetectionMode; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + object.stationaryCamera = message.stationaryCamera; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + LabelDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.LabelDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.LabelDetectionConfig"; + }; + + return LabelDetectionConfig; + })(); + + v1beta2.ShotChangeDetectionConfig = (function() { + + /** + * Properties of a ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IShotChangeDetectionConfig + * @property {string|null} [model] ShotChangeDetectionConfig model + */ + + /** + * Constructs a new ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a ShotChangeDetectionConfig. + * @implements IShotChangeDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig=} [properties] Properties to set + */ + function ShotChangeDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShotChangeDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @instance + */ + ShotChangeDetectionConfig.prototype.model = ""; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig} ShotChangeDetectionConfig instance + */ + ShotChangeDetectionConfig.create = function create(properties) { + return new ShotChangeDetectionConfig(properties); + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decode = function 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.videointelligence.v1beta2.ShotChangeDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShotChangeDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig} ShotChangeDetectionConfig + */ + ShotChangeDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig} message ShotChangeDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShotChangeDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ShotChangeDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShotChangeDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig"; + }; + + return ShotChangeDetectionConfig; + })(); + + v1beta2.ExplicitContentDetectionConfig = (function() { + + /** + * Properties of an ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IExplicitContentDetectionConfig + * @property {string|null} [model] ExplicitContentDetectionConfig model + */ + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an ExplicitContentDetectionConfig. + * @implements IExplicitContentDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig=} [properties] Properties to set + */ + function ExplicitContentDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @instance + */ + ExplicitContentDetectionConfig.prototype.model = ""; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig instance + */ + ExplicitContentDetectionConfig.create = function create(properties) { + return new ExplicitContentDetectionConfig(properties); + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decode = function 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.videointelligence.v1beta2.ExplicitContentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + */ + ExplicitContentDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig} message ExplicitContentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig"; + }; + + return ExplicitContentDetectionConfig; + })(); + + v1beta2.FaceDetectionConfig = (function() { + + /** + * Properties of a FaceDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IFaceDetectionConfig + * @property {string|null} [model] FaceDetectionConfig model + * @property {boolean|null} [includeBoundingBoxes] FaceDetectionConfig includeBoundingBoxes + */ + + /** + * Constructs a new FaceDetectionConfig. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a FaceDetectionConfig. + * @implements IFaceDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IFaceDetectionConfig=} [properties] Properties to set + */ + function FaceDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.model = ""; + + /** + * FaceDetectionConfig includeBoundingBoxes. + * @member {boolean} includeBoundingBoxes + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.includeBoundingBoxes = false; + + /** + * Creates a new FaceDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.FaceDetectionConfig} FaceDetectionConfig instance + */ + FaceDetectionConfig.create = function create(properties) { + return new FaceDetectionConfig(properties); + }; + + /** + * Encodes the specified FaceDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceDetectionConfig} message FaceDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.includeBoundingBoxes != null && Object.hasOwnProperty.call(message, "includeBoundingBoxes")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeBoundingBoxes); + return writer; + }; + + /** + * Encodes the specified FaceDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceDetectionConfig} message FaceDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.FaceDetectionConfig} FaceDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionConfig.decode = function 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.videointelligence.v1beta2.FaceDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.includeBoundingBoxes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.FaceDetectionConfig} FaceDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + if (typeof message.includeBoundingBoxes !== "boolean") + return "includeBoundingBoxes: boolean expected"; + return null; + }; + + /** + * Creates a FaceDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.FaceDetectionConfig} FaceDetectionConfig + */ + FaceDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.FaceDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + if (object.includeBoundingBoxes != null) + message.includeBoundingBoxes = Boolean(object.includeBoundingBoxes); + return message; + }; + + /** + * Creates a plain object from a FaceDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1beta2.FaceDetectionConfig} message FaceDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.includeBoundingBoxes = false; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + object.includeBoundingBoxes = message.includeBoundingBoxes; + return object; + }; + + /** + * Converts this FaceDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + FaceDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.FaceDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.FaceDetectionConfig"; + }; + + return FaceDetectionConfig; + })(); + + v1beta2.VideoSegment = (function() { + + /** + * Properties of a VideoSegment. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IVideoSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] VideoSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] VideoSegment endTimeOffset + */ + + /** + * Constructs a new VideoSegment. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a VideoSegment. + * @implements IVideoSegment + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IVideoSegment=} [properties] Properties to set + */ + function VideoSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @instance + */ + VideoSegment.prototype.startTimeOffset = null; + + /** + * VideoSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @instance + */ + VideoSegment.prototype.endTimeOffset = null; + + /** + * Creates a new VideoSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.VideoSegment} VideoSegment instance + */ + VideoSegment.create = function create(properties) { + return new VideoSegment(properties); + }; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.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(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decode = function 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.videointelligence.v1beta2.VideoSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoSegment.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; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.VideoSegment} VideoSegment + */ + VideoSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.VideoSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.VideoSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoSegment.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.videointelligence.v1beta2.VideoSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.VideoSegment} message VideoSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeOffset = null; + object.endTimeOffset = null; + } + 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 VideoSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @instance + * @returns {Object.} JSON object + */ + VideoSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.VideoSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.VideoSegment"; + }; + + return VideoSegment; + })(); + + v1beta2.LabelSegment = (function() { + + /** + * Properties of a LabelSegment. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface ILabelSegment + * @property {google.cloud.videointelligence.v1beta2.IVideoSegment|null} [segment] LabelSegment segment + * @property {number|null} [confidence] LabelSegment confidence + */ + + /** + * Constructs a new LabelSegment. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a LabelSegment. + * @implements ILabelSegment + * @constructor + * @param {google.cloud.videointelligence.v1beta2.ILabelSegment=} [properties] Properties to set + */ + function LabelSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelSegment segment. + * @member {google.cloud.videointelligence.v1beta2.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @instance + */ + LabelSegment.prototype.segment = null; + + /** + * LabelSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @instance + */ + LabelSegment.prototype.confidence = 0; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.LabelSegment} LabelSegment instance + */ + LabelSegment.create = function create(properties) { + return new LabelSegment(properties); + }; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1beta2.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decode = function 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.videointelligence.v1beta2.LabelSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1beta2.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.LabelSegment} LabelSegment + */ + LabelSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.LabelSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.LabelSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1beta2.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.LabelSegment} message LabelSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1beta2.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @instance + * @returns {Object.} JSON object + */ + LabelSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.LabelSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.LabelSegment"; + }; + + return LabelSegment; + })(); + + v1beta2.LabelFrame = (function() { + + /** + * Properties of a LabelFrame. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface ILabelFrame + * @property {google.protobuf.IDuration|null} [timeOffset] LabelFrame timeOffset + * @property {number|null} [confidence] LabelFrame confidence + */ + + /** + * Constructs a new LabelFrame. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a LabelFrame. + * @implements ILabelFrame + * @constructor + * @param {google.cloud.videointelligence.v1beta2.ILabelFrame=} [properties] Properties to set + */ + function LabelFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @instance + */ + LabelFrame.prototype.timeOffset = null; + + /** + * LabelFrame confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @instance + */ + LabelFrame.prototype.confidence = 0; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.LabelFrame} LabelFrame instance + */ + LabelFrame.create = function create(properties) { + return new LabelFrame(properties); + }; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decode = function 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.videointelligence.v1beta2.LabelFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.LabelFrame} LabelFrame + */ + LabelFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.LabelFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.LabelFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.LabelFrame} message LabelFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.confidence = 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @instance + * @returns {Object.} JSON object + */ + LabelFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.LabelFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.LabelFrame"; + }; + + return LabelFrame; + })(); + + v1beta2.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IEntity + * @property {string|null} [entityId] Entity entityId + * @property {string|null} [description] Entity description + * @property {string|null} [languageCode] Entity languageCode + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity entityId. + * @member {string} entityId + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @instance + */ + Entity.prototype.entityId = ""; + + /** + * Entity description. + * @member {string} description + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @instance + */ + Entity.prototype.description = ""; + + /** + * Entity languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @instance + */ + Entity.prototype.languageCode = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {google.cloud.videointelligence.v1beta2.IEntity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {google.cloud.videointelligence.v1beta2.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {google.cloud.videointelligence.v1beta2.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function 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.videointelligence.v1beta2.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.Entity) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.Entity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {google.cloud.videointelligence.v1beta2.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.description = ""; + object.languageCode = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.Entity"; + }; + + return Entity; + })(); + + v1beta2.LabelAnnotation = (function() { + + /** + * Properties of a LabelAnnotation. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface ILabelAnnotation + * @property {google.cloud.videointelligence.v1beta2.IEntity|null} [entity] LabelAnnotation entity + * @property {Array.|null} [categoryEntities] LabelAnnotation categoryEntities + * @property {Array.|null} [segments] LabelAnnotation segments + * @property {Array.|null} [frames] LabelAnnotation frames + */ + + /** + * Constructs a new LabelAnnotation. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a LabelAnnotation. + * @implements ILabelAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1beta2.ILabelAnnotation=} [properties] Properties to set + */ + function LabelAnnotation(properties) { + this.categoryEntities = []; + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelAnnotation entity. + * @member {google.cloud.videointelligence.v1beta2.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.entity = null; + + /** + * LabelAnnotation categoryEntities. + * @member {Array.} categoryEntities + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.categoryEntities = $util.emptyArray; + + /** + * LabelAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.segments = $util.emptyArray; + + /** + * LabelAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.LabelAnnotation} LabelAnnotation instance + */ + LabelAnnotation.create = function create(properties) { + return new LabelAnnotation(properties); + }; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1beta2.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.categoryEntities != null && message.categoryEntities.length) + for (var i = 0; i < message.categoryEntities.length; ++i) + $root.google.cloud.videointelligence.v1beta2.Entity.encode(message.categoryEntities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1beta2.LabelSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1beta2.LabelFrame.encode(message.frames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.LabelAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decode = function 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.videointelligence.v1beta2.LabelAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1beta2.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.categoryEntities && message.categoryEntities.length)) + message.categoryEntities = []; + message.categoryEntities.push($root.google.cloud.videointelligence.v1beta2.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1beta2.LabelSegment.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1beta2.LabelFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1beta2.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.categoryEntities != null && message.hasOwnProperty("categoryEntities")) { + if (!Array.isArray(message.categoryEntities)) + return "categoryEntities: array expected"; + for (var i = 0; i < message.categoryEntities.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.Entity.verify(message.categoryEntities[i]); + if (error) + return "categoryEntities." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.LabelSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.LabelFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.LabelAnnotation} LabelAnnotation + */ + LabelAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.LabelAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.LabelAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1beta2.Entity.fromObject(object.entity); + } + if (object.categoryEntities) { + if (!Array.isArray(object.categoryEntities)) + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.categoryEntities: array expected"); + message.categoryEntities = []; + for (var i = 0; i < object.categoryEntities.length; ++i) { + if (typeof object.categoryEntities[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.categoryEntities: object expected"); + message.categoryEntities[i] = $root.google.cloud.videointelligence.v1beta2.Entity.fromObject(object.categoryEntities[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1beta2.LabelSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.LabelAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1beta2.LabelFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.LabelAnnotation} message LabelAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categoryEntities = []; + object.segments = []; + object.frames = []; + } + if (options.defaults) + object.entity = null; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1beta2.Entity.toObject(message.entity, options); + if (message.categoryEntities && message.categoryEntities.length) { + object.categoryEntities = []; + for (var j = 0; j < message.categoryEntities.length; ++j) + object.categoryEntities[j] = $root.google.cloud.videointelligence.v1beta2.Entity.toObject(message.categoryEntities[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1beta2.LabelSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1beta2.LabelFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this LabelAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @instance + * @returns {Object.} JSON object + */ + LabelAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.LabelAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.LabelAnnotation"; + }; + + return LabelAnnotation; + })(); + + v1beta2.ExplicitContentFrame = (function() { + + /** + * Properties of an ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IExplicitContentFrame + * @property {google.protobuf.IDuration|null} [timeOffset] ExplicitContentFrame timeOffset + * @property {google.cloud.videointelligence.v1beta2.Likelihood|null} [pornographyLikelihood] ExplicitContentFrame pornographyLikelihood + */ + + /** + * Constructs a new ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an ExplicitContentFrame. + * @implements IExplicitContentFrame + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentFrame=} [properties] Properties to set + */ + function ExplicitContentFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.timeOffset = null; + + /** + * ExplicitContentFrame pornographyLikelihood. + * @member {google.cloud.videointelligence.v1beta2.Likelihood} pornographyLikelihood + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.pornographyLikelihood = 0; + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentFrame} ExplicitContentFrame instance + */ + ExplicitContentFrame.create = function create(properties) { + return new ExplicitContentFrame(properties); + }; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pornographyLikelihood != null && Object.hasOwnProperty.call(message, "pornographyLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pornographyLikelihood); + return writer; + }; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decode = function 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.videointelligence.v1beta2.ExplicitContentFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pornographyLikelihood = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + switch (message.pornographyLikelihood) { + default: + return "pornographyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentFrame} ExplicitContentFrame + */ + ExplicitContentFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.ExplicitContentFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + switch (object.pornographyLikelihood) { + default: + if (typeof object.pornographyLikelihood === "number") { + message.pornographyLikelihood = object.pornographyLikelihood; + break; + } + break; + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.pornographyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.pornographyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.pornographyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.pornographyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.pornographyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.pornographyLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.ExplicitContentFrame} message ExplicitContentFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.pornographyLikelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + object.pornographyLikelihood = options.enums === String ? $root.google.cloud.videointelligence.v1beta2.Likelihood[message.pornographyLikelihood] === undefined ? message.pornographyLikelihood : $root.google.cloud.videointelligence.v1beta2.Likelihood[message.pornographyLikelihood] : message.pornographyLikelihood; + return object; + }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.ExplicitContentFrame"; + }; + + return ExplicitContentFrame; + })(); + + v1beta2.ExplicitContentAnnotation = (function() { + + /** + * Properties of an ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IExplicitContentAnnotation + * @property {Array.|null} [frames] ExplicitContentAnnotation frames + */ + + /** + * Constructs a new ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an ExplicitContentAnnotation. + * @implements IExplicitContentAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation=} [properties] Properties to set + */ + function ExplicitContentAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @instance + */ + ExplicitContentAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation} ExplicitContentAnnotation instance + */ + ExplicitContentAnnotation.create = function create(properties) { + return new ExplicitContentAnnotation(properties); + }; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame.encode(message.frames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decode = function 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.videointelligence.v1beta2.ExplicitContentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates an ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation} ExplicitContentAnnotation + */ + ExplicitContentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation(); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation} message ExplicitContentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1beta2.ExplicitContentFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation"; + }; + + return ExplicitContentAnnotation; + })(); + + v1beta2.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface INormalizedBoundingBox + * @property {number|null} [left] NormalizedBoundingBox left + * @property {number|null} [top] NormalizedBoundingBox top + * @property {number|null} [right] NormalizedBoundingBox right + * @property {number|null} [bottom] NormalizedBoundingBox bottom + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.videointelligence.v1beta2.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox left. + * @member {number} left + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.left = 0; + + /** + * NormalizedBoundingBox top. + * @member {number} top + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.top = 0; + + /** + * NormalizedBoundingBox right. + * @member {number} right + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.right = 0; + + /** + * NormalizedBoundingBox bottom. + * @member {number} bottom + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.bottom = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1beta2.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1beta2.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.left); + if (message.top != null && Object.hasOwnProperty.call(message, "top")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.top); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.right); + if (message.bottom != null && Object.hasOwnProperty.call(message, "bottom")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.bottom); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1beta2.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function 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.videointelligence.v1beta2.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.left = reader.float(); + break; + } + case 2: { + message.top = reader.float(); + break; + } + case 3: { + message.right = reader.float(); + break; + } + case 4: { + message.bottom = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.left != null && message.hasOwnProperty("left")) + if (typeof message.left !== "number") + return "left: number expected"; + if (message.top != null && message.hasOwnProperty("top")) + if (typeof message.top !== "number") + return "top: number expected"; + if (message.right != null && message.hasOwnProperty("right")) + if (typeof message.right !== "number") + return "right: number expected"; + if (message.bottom != null && message.hasOwnProperty("bottom")) + if (typeof message.bottom !== "number") + return "bottom: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox(); + if (object.left != null) + message.left = Number(object.left); + if (object.top != null) + message.top = Number(object.top); + if (object.right != null) + message.right = Number(object.right); + if (object.bottom != null) + message.bottom = Number(object.bottom); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1beta2.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.left = 0; + object.top = 0; + object.right = 0; + object.bottom = 0; + } + if (message.left != null && message.hasOwnProperty("left")) + object.left = options.json && !isFinite(message.left) ? String(message.left) : message.left; + if (message.top != null && message.hasOwnProperty("top")) + object.top = options.json && !isFinite(message.top) ? String(message.top) : message.top; + if (message.right != null && message.hasOwnProperty("right")) + object.right = options.json && !isFinite(message.right) ? String(message.right) : message.right; + if (message.bottom != null && message.hasOwnProperty("bottom")) + object.bottom = options.json && !isFinite(message.bottom) ? String(message.bottom) : message.bottom; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + v1beta2.FaceSegment = (function() { + + /** + * Properties of a FaceSegment. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IFaceSegment + * @property {google.cloud.videointelligence.v1beta2.IVideoSegment|null} [segment] FaceSegment segment + */ + + /** + * Constructs a new FaceSegment. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a FaceSegment. + * @implements IFaceSegment + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IFaceSegment=} [properties] Properties to set + */ + function FaceSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceSegment segment. + * @member {google.cloud.videointelligence.v1beta2.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @instance + */ + FaceSegment.prototype.segment = null; + + /** + * Creates a new FaceSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.FaceSegment} FaceSegment instance + */ + FaceSegment.create = function create(properties) { + return new FaceSegment(properties); + }; + + /** + * Encodes the specified FaceSegment message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceSegment} message FaceSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1beta2.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaceSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceSegment} message FaceSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.FaceSegment} FaceSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceSegment.decode = function 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.videointelligence.v1beta2.FaceSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1beta2.VideoSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.FaceSegment} FaceSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + return null; + }; + + /** + * Creates a FaceSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.FaceSegment} FaceSegment + */ + FaceSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.FaceSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.FaceSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1beta2.VideoSegment.fromObject(object.segment); + } + return message; + }; + + /** + * Creates a plain object from a FaceSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {google.cloud.videointelligence.v1beta2.FaceSegment} message FaceSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.segment = null; + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1beta2.VideoSegment.toObject(message.segment, options); + return object; + }; + + /** + * Converts this FaceSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @instance + * @returns {Object.} JSON object + */ + FaceSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.FaceSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.FaceSegment"; + }; + + return FaceSegment; + })(); + + v1beta2.FaceFrame = (function() { + + /** + * Properties of a FaceFrame. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IFaceFrame + * @property {Array.|null} [normalizedBoundingBoxes] FaceFrame normalizedBoundingBoxes + * @property {google.protobuf.IDuration|null} [timeOffset] FaceFrame timeOffset + */ + + /** + * Constructs a new FaceFrame. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a FaceFrame. + * @implements IFaceFrame + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IFaceFrame=} [properties] Properties to set + */ + function FaceFrame(properties) { + this.normalizedBoundingBoxes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceFrame normalizedBoundingBoxes. + * @member {Array.} normalizedBoundingBoxes + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @instance + */ + FaceFrame.prototype.normalizedBoundingBoxes = $util.emptyArray; + + /** + * FaceFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @instance + */ + FaceFrame.prototype.timeOffset = null; + + /** + * Creates a new FaceFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.FaceFrame} FaceFrame instance + */ + FaceFrame.create = function create(properties) { + return new FaceFrame(properties); + }; + + /** + * Encodes the specified FaceFrame message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceFrame} message FaceFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBoxes != null && message.normalizedBoundingBoxes.length) + for (var i = 0; i < message.normalizedBoundingBoxes.length; ++i) + $root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.encode(message.normalizedBoundingBoxes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaceFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceFrame} message FaceFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.FaceFrame} FaceFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceFrame.decode = function 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.videointelligence.v1beta2.FaceFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.normalizedBoundingBoxes && message.normalizedBoundingBoxes.length)) + message.normalizedBoundingBoxes = []; + message.normalizedBoundingBoxes.push($root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.decode(reader, reader.uint32())); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.FaceFrame} FaceFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBoxes != null && message.hasOwnProperty("normalizedBoundingBoxes")) { + if (!Array.isArray(message.normalizedBoundingBoxes)) + return "normalizedBoundingBoxes: array expected"; + for (var i = 0; i < message.normalizedBoundingBoxes.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.verify(message.normalizedBoundingBoxes[i]); + if (error) + return "normalizedBoundingBoxes." + error; + } + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates a FaceFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.FaceFrame} FaceFrame + */ + FaceFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.FaceFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.FaceFrame(); + if (object.normalizedBoundingBoxes) { + if (!Array.isArray(object.normalizedBoundingBoxes)) + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceFrame.normalizedBoundingBoxes: array expected"); + message.normalizedBoundingBoxes = []; + for (var i = 0; i < object.normalizedBoundingBoxes.length; ++i) { + if (typeof object.normalizedBoundingBoxes[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceFrame.normalizedBoundingBoxes: object expected"); + message.normalizedBoundingBoxes[i] = $root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.fromObject(object.normalizedBoundingBoxes[i]); + } + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from a FaceFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {google.cloud.videointelligence.v1beta2.FaceFrame} message FaceFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedBoundingBoxes = []; + if (options.defaults) + object.timeOffset = null; + if (message.normalizedBoundingBoxes && message.normalizedBoundingBoxes.length) { + object.normalizedBoundingBoxes = []; + for (var j = 0; j < message.normalizedBoundingBoxes.length; ++j) + object.normalizedBoundingBoxes[j] = $root.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.toObject(message.normalizedBoundingBoxes[j], options); + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this FaceFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @instance + * @returns {Object.} JSON object + */ + FaceFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.FaceFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.FaceFrame"; + }; + + return FaceFrame; + })(); + + v1beta2.FaceAnnotation = (function() { + + /** + * Properties of a FaceAnnotation. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IFaceAnnotation + * @property {Uint8Array|null} [thumbnail] FaceAnnotation thumbnail + * @property {Array.|null} [segments] FaceAnnotation segments + * @property {Array.|null} [frames] FaceAnnotation frames + */ + + /** + * Constructs a new FaceAnnotation. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a FaceAnnotation. + * @implements IFaceAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IFaceAnnotation=} [properties] Properties to set + */ + function FaceAnnotation(properties) { + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceAnnotation thumbnail. + * @member {Uint8Array} thumbnail + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.thumbnail = $util.newBuffer([]); + + /** + * FaceAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.segments = $util.emptyArray; + + /** + * FaceAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @instance + */ + FaceAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new FaceAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.FaceAnnotation} FaceAnnotation instance + */ + FaceAnnotation.create = function create(properties) { + return new FaceAnnotation(properties); + }; + + /** + * Encodes the specified FaceAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.thumbnail); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1beta2.FaceSegment.encode(message.segments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1beta2.FaceFrame.encode(message.frames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaceAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.FaceAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.IFaceAnnotation} message FaceAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decode = function 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.videointelligence.v1beta2.FaceAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.thumbnail = reader.bytes(); + break; + } + case 2: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1beta2.FaceSegment.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1beta2.FaceFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.FaceAnnotation} FaceAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) + return "thumbnail: buffer expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.FaceSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.FaceFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a FaceAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.FaceAnnotation} FaceAnnotation + */ + FaceAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.FaceAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.FaceAnnotation(); + if (object.thumbnail != null) + if (typeof object.thumbnail === "string") + $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); + else if (object.thumbnail.length >= 0) + message.thumbnail = object.thumbnail; + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1beta2.FaceSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.FaceAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1beta2.FaceFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FaceAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {google.cloud.videointelligence.v1beta2.FaceAnnotation} message FaceAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segments = []; + object.frames = []; + } + if (options.defaults) + if (options.bytes === String) + object.thumbnail = ""; + else { + object.thumbnail = []; + if (options.bytes !== Array) + object.thumbnail = $util.newBuffer(object.thumbnail); + } + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1beta2.FaceSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1beta2.FaceFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this FaceAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.FaceAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.FaceAnnotation"; + }; + + return FaceAnnotation; + })(); + + v1beta2.VideoAnnotationResults = (function() { + + /** + * Properties of a VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IVideoAnnotationResults + * @property {string|null} [inputUri] VideoAnnotationResults inputUri + * @property {Array.|null} [segmentLabelAnnotations] VideoAnnotationResults segmentLabelAnnotations + * @property {Array.|null} [shotLabelAnnotations] VideoAnnotationResults shotLabelAnnotations + * @property {Array.|null} [frameLabelAnnotations] VideoAnnotationResults frameLabelAnnotations + * @property {Array.|null} [faceAnnotations] VideoAnnotationResults faceAnnotations + * @property {Array.|null} [shotAnnotations] VideoAnnotationResults shotAnnotations + * @property {google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation|null} [explicitAnnotation] VideoAnnotationResults explicitAnnotation + * @property {google.rpc.IStatus|null} [error] VideoAnnotationResults error + */ + + /** + * Constructs a new VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a VideoAnnotationResults. + * @implements IVideoAnnotationResults + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationResults=} [properties] Properties to set + */ + function VideoAnnotationResults(properties) { + this.segmentLabelAnnotations = []; + this.shotLabelAnnotations = []; + this.frameLabelAnnotations = []; + this.faceAnnotations = []; + this.shotAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationResults inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.inputUri = ""; + + /** + * VideoAnnotationResults segmentLabelAnnotations. + * @member {Array.} segmentLabelAnnotations + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotLabelAnnotations. + * @member {Array.} shotLabelAnnotations + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults frameLabelAnnotations. + * @member {Array.} frameLabelAnnotations + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.frameLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults faceAnnotations. + * @member {Array.} faceAnnotations + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.faceAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotAnnotations. + * @member {Array.} shotAnnotations + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults explicitAnnotation. + * @member {google.cloud.videointelligence.v1beta2.IExplicitContentAnnotation|null|undefined} explicitAnnotation + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.explicitAnnotation = null; + + /** + * VideoAnnotationResults error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.error = null; + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationResults=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationResults} VideoAnnotationResults instance + */ + VideoAnnotationResults.create = function create(properties) { + return new VideoAnnotationResults(properties); + }; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.segmentLabelAnnotations != null && message.segmentLabelAnnotations.length) + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.encode(message.segmentLabelAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotLabelAnnotations != null && message.shotLabelAnnotations.length) + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.encode(message.shotLabelAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frameLabelAnnotations != null && message.frameLabelAnnotations.length) + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.encode(message.frameLabelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.faceAnnotations != null && message.faceAnnotations.length) + for (var i = 0; i < message.faceAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1beta2.FaceAnnotation.encode(message.faceAnnotations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.shotAnnotations != null && message.shotAnnotations.length) + for (var i = 0; i < message.shotAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1beta2.VideoSegment.encode(message.shotAnnotations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.explicitAnnotation != null && Object.hasOwnProperty.call(message, "explicitAnnotation")) + $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.encode(message.explicitAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decode = function 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.videointelligence.v1beta2.VideoAnnotationResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + if (!(message.segmentLabelAnnotations && message.segmentLabelAnnotations.length)) + message.segmentLabelAnnotations = []; + message.segmentLabelAnnotations.push($root.google.cloud.videointelligence.v1beta2.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.shotLabelAnnotations && message.shotLabelAnnotations.length)) + message.shotLabelAnnotations = []; + message.shotLabelAnnotations.push($root.google.cloud.videointelligence.v1beta2.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frameLabelAnnotations && message.frameLabelAnnotations.length)) + message.frameLabelAnnotations = []; + message.frameLabelAnnotations.push($root.google.cloud.videointelligence.v1beta2.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.faceAnnotations && message.faceAnnotations.length)) + message.faceAnnotations = []; + message.faceAnnotations.push($root.google.cloud.videointelligence.v1beta2.FaceAnnotation.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.shotAnnotations && message.shotAnnotations.length)) + message.shotAnnotations = []; + message.shotAnnotations.push($root.google.cloud.videointelligence.v1beta2.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.explicitAnnotation = $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.decode(reader, reader.uint32()); + break; + } + case 9: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationResults message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.segmentLabelAnnotations != null && message.hasOwnProperty("segmentLabelAnnotations")) { + if (!Array.isArray(message.segmentLabelAnnotations)) + return "segmentLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.verify(message.segmentLabelAnnotations[i]); + if (error) + return "segmentLabelAnnotations." + error; + } + } + if (message.shotLabelAnnotations != null && message.hasOwnProperty("shotLabelAnnotations")) { + if (!Array.isArray(message.shotLabelAnnotations)) + return "shotLabelAnnotations: array expected"; + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.verify(message.shotLabelAnnotations[i]); + if (error) + return "shotLabelAnnotations." + error; + } + } + if (message.frameLabelAnnotations != null && message.hasOwnProperty("frameLabelAnnotations")) { + if (!Array.isArray(message.frameLabelAnnotations)) + return "frameLabelAnnotations: array expected"; + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.verify(message.frameLabelAnnotations[i]); + if (error) + return "frameLabelAnnotations." + error; + } + } + if (message.faceAnnotations != null && message.hasOwnProperty("faceAnnotations")) { + if (!Array.isArray(message.faceAnnotations)) + return "faceAnnotations: array expected"; + for (var i = 0; i < message.faceAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.FaceAnnotation.verify(message.faceAnnotations[i]); + if (error) + return "faceAnnotations." + error; + } + } + if (message.shotAnnotations != null && message.hasOwnProperty("shotAnnotations")) { + if (!Array.isArray(message.shotAnnotations)) + return "shotAnnotations: array expected"; + for (var i = 0; i < message.shotAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoSegment.verify(message.shotAnnotations[i]); + if (error) + return "shotAnnotations." + error; + } + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) { + var error = $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.verify(message.explicitAnnotation); + if (error) + return "explicitAnnotation." + error; + } + 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 VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationResults} VideoAnnotationResults + */ + VideoAnnotationResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.segmentLabelAnnotations) { + if (!Array.isArray(object.segmentLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.segmentLabelAnnotations: array expected"); + message.segmentLabelAnnotations = []; + for (var i = 0; i < object.segmentLabelAnnotations.length; ++i) { + if (typeof object.segmentLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.segmentLabelAnnotations: object expected"); + message.segmentLabelAnnotations[i] = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.fromObject(object.segmentLabelAnnotations[i]); + } + } + if (object.shotLabelAnnotations) { + if (!Array.isArray(object.shotLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.shotLabelAnnotations: array expected"); + message.shotLabelAnnotations = []; + for (var i = 0; i < object.shotLabelAnnotations.length; ++i) { + if (typeof object.shotLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.shotLabelAnnotations: object expected"); + message.shotLabelAnnotations[i] = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.fromObject(object.shotLabelAnnotations[i]); + } + } + if (object.frameLabelAnnotations) { + if (!Array.isArray(object.frameLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.frameLabelAnnotations: array expected"); + message.frameLabelAnnotations = []; + for (var i = 0; i < object.frameLabelAnnotations.length; ++i) { + if (typeof object.frameLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.frameLabelAnnotations: object expected"); + message.frameLabelAnnotations[i] = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.fromObject(object.frameLabelAnnotations[i]); + } + } + if (object.faceAnnotations) { + if (!Array.isArray(object.faceAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.faceAnnotations: array expected"); + message.faceAnnotations = []; + for (var i = 0; i < object.faceAnnotations.length; ++i) { + if (typeof object.faceAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.faceAnnotations: object expected"); + message.faceAnnotations[i] = $root.google.cloud.videointelligence.v1beta2.FaceAnnotation.fromObject(object.faceAnnotations[i]); + } + } + if (object.shotAnnotations) { + if (!Array.isArray(object.shotAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.shotAnnotations: array expected"); + message.shotAnnotations = []; + for (var i = 0; i < object.shotAnnotations.length; ++i) { + if (typeof object.shotAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.shotAnnotations: object expected"); + message.shotAnnotations[i] = $root.google.cloud.videointelligence.v1beta2.VideoSegment.fromObject(object.shotAnnotations[i]); + } + } + if (object.explicitAnnotation != null) { + if (typeof object.explicitAnnotation !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.explicitAnnotation: object expected"); + message.explicitAnnotation = $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.fromObject(object.explicitAnnotation); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationResults.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1beta2.VideoAnnotationResults} message VideoAnnotationResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segmentLabelAnnotations = []; + object.shotLabelAnnotations = []; + object.frameLabelAnnotations = []; + object.faceAnnotations = []; + object.shotAnnotations = []; + } + if (options.defaults) { + object.inputUri = ""; + object.explicitAnnotation = null; + object.error = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.segmentLabelAnnotations && message.segmentLabelAnnotations.length) { + object.segmentLabelAnnotations = []; + for (var j = 0; j < message.segmentLabelAnnotations.length; ++j) + object.segmentLabelAnnotations[j] = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.toObject(message.segmentLabelAnnotations[j], options); + } + if (message.shotLabelAnnotations && message.shotLabelAnnotations.length) { + object.shotLabelAnnotations = []; + for (var j = 0; j < message.shotLabelAnnotations.length; ++j) + object.shotLabelAnnotations[j] = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.toObject(message.shotLabelAnnotations[j], options); + } + if (message.frameLabelAnnotations && message.frameLabelAnnotations.length) { + object.frameLabelAnnotations = []; + for (var j = 0; j < message.frameLabelAnnotations.length; ++j) + object.frameLabelAnnotations[j] = $root.google.cloud.videointelligence.v1beta2.LabelAnnotation.toObject(message.frameLabelAnnotations[j], options); + } + if (message.faceAnnotations && message.faceAnnotations.length) { + object.faceAnnotations = []; + for (var j = 0; j < message.faceAnnotations.length; ++j) + object.faceAnnotations[j] = $root.google.cloud.videointelligence.v1beta2.FaceAnnotation.toObject(message.faceAnnotations[j], options); + } + if (message.shotAnnotations && message.shotAnnotations.length) { + object.shotAnnotations = []; + for (var j = 0; j < message.shotAnnotations.length; ++j) + object.shotAnnotations[j] = $root.google.cloud.videointelligence.v1beta2.VideoSegment.toObject(message.shotAnnotations[j], options); + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) + object.explicitAnnotation = $root.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.toObject(message.explicitAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + return object; + }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationResults + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.VideoAnnotationResults"; + }; + + return VideoAnnotationResults; + })(); + + v1beta2.AnnotateVideoResponse = (function() { + + /** + * Properties of an AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IAnnotateVideoResponse + * @property {Array.|null} [annotationResults] AnnotateVideoResponse annotationResults + */ + + /** + * Constructs a new AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an AnnotateVideoResponse. + * @implements IAnnotateVideoResponse + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse=} [properties] Properties to set + */ + function AnnotateVideoResponse(properties) { + this.annotationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoResponse annotationResults. + * @member {Array.} annotationResults + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @instance + */ + AnnotateVideoResponse.prototype.annotationResults = $util.emptyArray; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoResponse} AnnotateVideoResponse instance + */ + AnnotateVideoResponse.create = function create(properties) { + return new AnnotateVideoResponse(properties); + }; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationResults != null && message.annotationResults.length) + for (var i = 0; i < message.annotationResults.length; ++i) + $root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults.encode(message.annotationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decode = function 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.videointelligence.v1beta2.AnnotateVideoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationResults && message.annotationResults.length)) + message.annotationResults = []; + message.annotationResults.push($root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoResponse message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) { + if (!Array.isArray(message.annotationResults)) + return "annotationResults: array expected"; + for (var i = 0; i < message.annotationResults.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults.verify(message.annotationResults[i]); + if (error) + return "annotationResults." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoResponse} AnnotateVideoResponse + */ + AnnotateVideoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse(); + if (object.annotationResults) { + if (!Array.isArray(object.annotationResults)) + throw TypeError(".google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.annotationResults: array expected"); + message.annotationResults = []; + for (var i = 0; i < object.annotationResults.length; ++i) { + if (typeof object.annotationResults[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.annotationResults: object expected"); + message.annotationResults[i] = $root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults.fromObject(object.annotationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1beta2.AnnotateVideoResponse} message AnnotateVideoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationResults = []; + if (message.annotationResults && message.annotationResults.length) { + object.annotationResults = []; + for (var j = 0; j < message.annotationResults.length; ++j) + object.annotationResults[j] = $root.google.cloud.videointelligence.v1beta2.VideoAnnotationResults.toObject(message.annotationResults[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.AnnotateVideoResponse"; + }; + + return AnnotateVideoResponse; + })(); + + v1beta2.VideoAnnotationProgress = (function() { + + /** + * Properties of a VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IVideoAnnotationProgress + * @property {string|null} [inputUri] VideoAnnotationProgress inputUri + * @property {number|null} [progressPercent] VideoAnnotationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] VideoAnnotationProgress startTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VideoAnnotationProgress updateTime + */ + + /** + * Constructs a new VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents a VideoAnnotationProgress. + * @implements IVideoAnnotationProgress + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress=} [properties] Properties to set + */ + function VideoAnnotationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationProgress inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.inputUri = ""; + + /** + * VideoAnnotationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.progressPercent = 0; + + /** + * VideoAnnotationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.startTime = null; + + /** + * VideoAnnotationProgress updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.updateTime = null; + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationProgress} VideoAnnotationProgress instance + */ + VideoAnnotationProgress.create = function create(properties) { + return new VideoAnnotationProgress(properties); + }; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decode = function 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.videointelligence.v1beta2.VideoAnnotationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.progressPercent = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.VideoAnnotationProgress} VideoAnnotationProgress + */ + VideoAnnotationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.VideoAnnotationProgress} message VideoAnnotationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.progressPercent = 0; + object.startTime = null; + object.updateTime = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.VideoAnnotationProgress"; + }; + + return VideoAnnotationProgress; + })(); + + v1beta2.AnnotateVideoProgress = (function() { + + /** + * Properties of an AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1beta2 + * @interface IAnnotateVideoProgress + * @property {Array.|null} [annotationProgress] AnnotateVideoProgress annotationProgress + */ + + /** + * Constructs a new AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1beta2 + * @classdesc Represents an AnnotateVideoProgress. + * @implements IAnnotateVideoProgress + * @constructor + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress=} [properties] Properties to set + */ + function AnnotateVideoProgress(properties) { + this.annotationProgress = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoProgress annotationProgress. + * @member {Array.} annotationProgress + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @instance + */ + AnnotateVideoProgress.prototype.annotationProgress = $util.emptyArray; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoProgress} AnnotateVideoProgress instance + */ + AnnotateVideoProgress.create = function create(properties) { + return new AnnotateVideoProgress(properties); + }; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationProgress != null && message.annotationProgress.length) + for (var i = 0; i < message.annotationProgress.length; ++i) + $root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.encode(message.annotationProgress[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decode = function 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.videointelligence.v1beta2.AnnotateVideoProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationProgress && message.annotationProgress.length)) + message.annotationProgress = []; + message.annotationProgress.push($root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationProgress != null && message.hasOwnProperty("annotationProgress")) { + if (!Array.isArray(message.annotationProgress)) + return "annotationProgress: array expected"; + for (var i = 0; i < message.annotationProgress.length; ++i) { + var error = $root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.verify(message.annotationProgress[i]); + if (error) + return "annotationProgress." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1beta2.AnnotateVideoProgress} AnnotateVideoProgress + */ + AnnotateVideoProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress(); + if (object.annotationProgress) { + if (!Array.isArray(object.annotationProgress)) + throw TypeError(".google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.annotationProgress: array expected"); + message.annotationProgress = []; + for (var i = 0; i < object.annotationProgress.length; ++i) { + if (typeof object.annotationProgress[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.annotationProgress: object expected"); + message.annotationProgress[i] = $root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.fromObject(object.annotationProgress[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1beta2.AnnotateVideoProgress} message AnnotateVideoProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationProgress = []; + if (message.annotationProgress && message.annotationProgress.length) { + object.annotationProgress = []; + for (var j = 0; j < message.annotationProgress.length; ++j) + object.annotationProgress[j] = $root.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.toObject(message.annotationProgress[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1beta2.AnnotateVideoProgress"; + }; + + return AnnotateVideoProgress; + })(); + + /** + * Feature enum. + * @name google.cloud.videointelligence.v1beta2.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} LABEL_DETECTION=1 LABEL_DETECTION value + * @property {number} SHOT_CHANGE_DETECTION=2 SHOT_CHANGE_DETECTION value + * @property {number} EXPLICIT_CONTENT_DETECTION=3 EXPLICIT_CONTENT_DETECTION value + * @property {number} FACE_DETECTION=4 FACE_DETECTION value + */ + v1beta2.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LABEL_DETECTION"] = 1; + values[valuesById[2] = "SHOT_CHANGE_DETECTION"] = 2; + values[valuesById[3] = "EXPLICIT_CONTENT_DETECTION"] = 3; + values[valuesById[4] = "FACE_DETECTION"] = 4; + return values; + })(); + + /** + * LabelDetectionMode enum. + * @name google.cloud.videointelligence.v1beta2.LabelDetectionMode + * @enum {number} + * @property {number} LABEL_DETECTION_MODE_UNSPECIFIED=0 LABEL_DETECTION_MODE_UNSPECIFIED value + * @property {number} SHOT_MODE=1 SHOT_MODE value + * @property {number} FRAME_MODE=2 FRAME_MODE value + * @property {number} SHOT_AND_FRAME_MODE=3 SHOT_AND_FRAME_MODE value + */ + v1beta2.LabelDetectionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LABEL_DETECTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOT_MODE"] = 1; + values[valuesById[2] = "FRAME_MODE"] = 2; + values[valuesById[3] = "SHOT_AND_FRAME_MODE"] = 3; + return values; + })(); + + /** + * Likelihood enum. + * @name google.cloud.videointelligence.v1beta2.Likelihood + * @enum {number} + * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1beta2.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + return v1beta2; + })(); + + videointelligence.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.videointelligence + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.VideoIntelligenceService = (function() { + + /** + * Constructs a new VideoIntelligenceService service. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a VideoIntelligenceService + * @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 VideoIntelligenceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VideoIntelligenceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoIntelligenceService; + + /** + * Creates new VideoIntelligenceService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService + * @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 {VideoIntelligenceService} RPC service. Useful where requests and/or responses are streamed. + */ + VideoIntelligenceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService|annotateVideo}. + * @memberof google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService + * @typedef AnnotateVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @param {google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService.AnnotateVideoCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoIntelligenceService.prototype.annotateVideo = function annotateVideo(request, callback) { + return this.rpcCall(annotateVideo, $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnnotateVideo" }); + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VideoIntelligenceService; + })(); + + v1p1beta1.AnnotateVideoRequest = (function() { + + /** + * Properties of an AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IAnnotateVideoRequest + * @property {string|null} [inputUri] AnnotateVideoRequest inputUri + * @property {Uint8Array|null} [inputContent] AnnotateVideoRequest inputContent + * @property {Array.|null} [features] AnnotateVideoRequest features + * @property {google.cloud.videointelligence.v1p1beta1.IVideoContext|null} [videoContext] AnnotateVideoRequest videoContext + * @property {string|null} [outputUri] AnnotateVideoRequest outputUri + * @property {string|null} [locationId] AnnotateVideoRequest locationId + */ + + /** + * Constructs a new AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an AnnotateVideoRequest. + * @implements IAnnotateVideoRequest + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest=} [properties] Properties to set + */ + function AnnotateVideoRequest(properties) { + this.features = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoRequest inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputUri = ""; + + /** + * AnnotateVideoRequest inputContent. + * @member {Uint8Array} inputContent + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputContent = $util.newBuffer([]); + + /** + * AnnotateVideoRequest features. + * @member {Array.} features + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateVideoRequest videoContext. + * @member {google.cloud.videointelligence.v1p1beta1.IVideoContext|null|undefined} videoContext + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.videoContext = null; + + /** + * AnnotateVideoRequest outputUri. + * @member {string} outputUri + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.outputUri = ""; + + /** + * AnnotateVideoRequest locationId. + * @member {string} locationId + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.locationId = ""; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest} AnnotateVideoRequest instance + */ + AnnotateVideoRequest.create = function create(properties) { + return new AnnotateVideoRequest(properties); + }; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.features != null && message.features.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.features.length; ++i) + writer.int32(message.features[i]); + writer.ldelim(); + } + if (message.videoContext != null && Object.hasOwnProperty.call(message, "videoContext")) + $root.google.cloud.videointelligence.v1p1beta1.VideoContext.encode(message.videoContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUri); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + if (message.inputContent != null && Object.hasOwnProperty.call(message, "inputContent")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputContent); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decode = function 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.videointelligence.v1p1beta1.AnnotateVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 6: { + message.inputContent = reader.bytes(); + break; + } + case 2: { + if (!(message.features && message.features.length)) + message.features = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.features.push(reader.int32()); + } else + message.features.push(reader.int32()); + break; + } + case 3: { + message.videoContext = $root.google.cloud.videointelligence.v1p1beta1.VideoContext.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputUri = reader.string(); + break; + } + case 5: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoRequest message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + if (!(message.inputContent && typeof message.inputContent.length === "number" || $util.isString(message.inputContent))) + return "inputContent: buffer expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + switch (message.features[i]) { + default: + return "features: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + break; + } + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.VideoContext.verify(message.videoContext); + if (error) + return "videoContext." + error; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates an AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest} AnnotateVideoRequest + */ + AnnotateVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.inputContent != null) + if (typeof object.inputContent === "string") + $util.base64.decode(object.inputContent, message.inputContent = $util.newBuffer($util.base64.length(object.inputContent)), 0); + else if (object.inputContent.length >= 0) + message.inputContent = object.inputContent; + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + switch (object.features[i]) { + default: + if (typeof object.features[i] === "number") { + message.features[i] = object.features[i]; + break; + } + case "FEATURE_UNSPECIFIED": + case 0: + message.features[i] = 0; + break; + case "LABEL_DETECTION": + case 1: + message.features[i] = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.features[i] = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.features[i] = 3; + break; + case "SPEECH_TRANSCRIPTION": + case 6: + message.features[i] = 6; + break; + } + } + if (object.videoContext != null) { + if (typeof object.videoContext !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.videoContext: object expected"); + message.videoContext = $root.google.cloud.videointelligence.v1p1beta1.VideoContext.fromObject(object.videoContext); + } + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest} message AnnotateVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputUri = ""; + object.videoContext = null; + object.outputUri = ""; + object.locationId = ""; + if (options.bytes === String) + object.inputContent = ""; + else { + object.inputContent = []; + if (options.bytes !== Array) + object.inputContent = $util.newBuffer(object.inputContent); + } + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = options.enums === String ? $root.google.cloud.videointelligence.v1p1beta1.Feature[message.features[j]] === undefined ? message.features[j] : $root.google.cloud.videointelligence.v1p1beta1.Feature[message.features[j]] : message.features[j]; + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) + object.videoContext = $root.google.cloud.videointelligence.v1p1beta1.VideoContext.toObject(message.videoContext, options); + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + object.inputContent = options.bytes === String ? $util.base64.encode(message.inputContent, 0, message.inputContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputContent) : message.inputContent; + return object; + }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest"; + }; + + return AnnotateVideoRequest; + })(); + + v1p1beta1.VideoContext = (function() { + + /** + * Properties of a VideoContext. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IVideoContext + * @property {Array.|null} [segments] VideoContext segments + * @property {google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig|null} [labelDetectionConfig] VideoContext labelDetectionConfig + * @property {google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig|null} [shotChangeDetectionConfig] VideoContext shotChangeDetectionConfig + * @property {google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig|null} [explicitContentDetectionConfig] VideoContext explicitContentDetectionConfig + * @property {google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig|null} [speechTranscriptionConfig] VideoContext speechTranscriptionConfig + */ + + /** + * Constructs a new VideoContext. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a VideoContext. + * @implements IVideoContext + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IVideoContext=} [properties] Properties to set + */ + function VideoContext(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoContext segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @instance + */ + VideoContext.prototype.segments = $util.emptyArray; + + /** + * VideoContext labelDetectionConfig. + * @member {google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig|null|undefined} labelDetectionConfig + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @instance + */ + VideoContext.prototype.labelDetectionConfig = null; + + /** + * VideoContext shotChangeDetectionConfig. + * @member {google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig|null|undefined} shotChangeDetectionConfig + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @instance + */ + VideoContext.prototype.shotChangeDetectionConfig = null; + + /** + * VideoContext explicitContentDetectionConfig. + * @member {google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig|null|undefined} explicitContentDetectionConfig + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @instance + */ + VideoContext.prototype.explicitContentDetectionConfig = null; + + /** + * VideoContext speechTranscriptionConfig. + * @member {google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig|null|undefined} speechTranscriptionConfig + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @instance + */ + VideoContext.prototype.speechTranscriptionConfig = null; + + /** + * Creates a new VideoContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.VideoContext} VideoContext instance + */ + VideoContext.create = function create(properties) { + return new VideoContext(properties); + }; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labelDetectionConfig != null && Object.hasOwnProperty.call(message, "labelDetectionConfig")) + $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.encode(message.labelDetectionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotChangeDetectionConfig != null && Object.hasOwnProperty.call(message, "shotChangeDetectionConfig")) + $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.encode(message.shotChangeDetectionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explicitContentDetectionConfig != null && Object.hasOwnProperty.call(message, "explicitContentDetectionConfig")) + $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.encode(message.explicitContentDetectionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.speechTranscriptionConfig != null && Object.hasOwnProperty.call(message, "speechTranscriptionConfig")) + $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.encode(message.speechTranscriptionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decode = function 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.videointelligence.v1p1beta1.VideoContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p1beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.verify(message.labelDetectionConfig); + if (error) + return "labelDetectionConfig." + error; + } + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.verify(message.shotChangeDetectionConfig); + if (error) + return "shotChangeDetectionConfig." + error; + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.verify(message.explicitContentDetectionConfig); + if (error) + return "explicitContentDetectionConfig." + error; + } + if (message.speechTranscriptionConfig != null && message.hasOwnProperty("speechTranscriptionConfig")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.verify(message.speechTranscriptionConfig); + if (error) + return "speechTranscriptionConfig." + error; + } + return null; + }; + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.VideoContext} VideoContext + */ + VideoContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.VideoContext) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.VideoContext(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoContext.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoContext.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.fromObject(object.segments[i]); + } + } + if (object.labelDetectionConfig != null) { + if (typeof object.labelDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoContext.labelDetectionConfig: object expected"); + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.fromObject(object.labelDetectionConfig); + } + if (object.shotChangeDetectionConfig != null) { + if (typeof object.shotChangeDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoContext.shotChangeDetectionConfig: object expected"); + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.fromObject(object.shotChangeDetectionConfig); + } + if (object.explicitContentDetectionConfig != null) { + if (typeof object.explicitContentDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoContext.explicitContentDetectionConfig: object expected"); + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.fromObject(object.explicitContentDetectionConfig); + } + if (object.speechTranscriptionConfig != null) { + if (typeof object.speechTranscriptionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoContext.speechTranscriptionConfig: object expected"); + message.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.fromObject(object.speechTranscriptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.VideoContext} message VideoContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) { + object.labelDetectionConfig = null; + object.shotChangeDetectionConfig = null; + object.explicitContentDetectionConfig = null; + object.speechTranscriptionConfig = null; + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.toObject(message.segments[j], options); + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) + object.labelDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.toObject(message.labelDetectionConfig, options); + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) + object.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.toObject(message.shotChangeDetectionConfig, options); + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) + object.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.toObject(message.explicitContentDetectionConfig, options); + if (message.speechTranscriptionConfig != null && message.hasOwnProperty("speechTranscriptionConfig")) + object.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.toObject(message.speechTranscriptionConfig, options); + return object; + }; + + /** + * Converts this VideoContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @instance + * @returns {Object.} JSON object + */ + VideoContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.VideoContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.VideoContext"; + }; + + return VideoContext; + })(); + + v1p1beta1.LabelDetectionConfig = (function() { + + /** + * Properties of a LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ILabelDetectionConfig + * @property {google.cloud.videointelligence.v1p1beta1.LabelDetectionMode|null} [labelDetectionMode] LabelDetectionConfig labelDetectionMode + * @property {boolean|null} [stationaryCamera] LabelDetectionConfig stationaryCamera + * @property {string|null} [model] LabelDetectionConfig model + */ + + /** + * Constructs a new LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a LabelDetectionConfig. + * @implements ILabelDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig=} [properties] Properties to set + */ + function LabelDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelDetectionConfig labelDetectionMode. + * @member {google.cloud.videointelligence.v1p1beta1.LabelDetectionMode} labelDetectionMode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.labelDetectionMode = 0; + + /** + * LabelDetectionConfig stationaryCamera. + * @member {boolean} stationaryCamera + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.stationaryCamera = false; + + /** + * LabelDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.model = ""; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig} LabelDetectionConfig instance + */ + LabelDetectionConfig.create = function create(properties) { + return new LabelDetectionConfig(properties); + }; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelDetectionMode != null && Object.hasOwnProperty.call(message, "labelDetectionMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelDetectionMode); + if (message.stationaryCamera != null && Object.hasOwnProperty.call(message, "stationaryCamera")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.stationaryCamera); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decode = function 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.videointelligence.v1p1beta1.LabelDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelDetectionMode = reader.int32(); + break; + } + case 2: { + message.stationaryCamera = reader.bool(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + switch (message.labelDetectionMode) { + default: + return "labelDetectionMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + if (typeof message.stationaryCamera !== "boolean") + return "stationaryCamera: boolean expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig} LabelDetectionConfig + */ + LabelDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig(); + switch (object.labelDetectionMode) { + default: + if (typeof object.labelDetectionMode === "number") { + message.labelDetectionMode = object.labelDetectionMode; + break; + } + break; + case "LABEL_DETECTION_MODE_UNSPECIFIED": + case 0: + message.labelDetectionMode = 0; + break; + case "SHOT_MODE": + case 1: + message.labelDetectionMode = 1; + break; + case "FRAME_MODE": + case 2: + message.labelDetectionMode = 2; + break; + case "SHOT_AND_FRAME_MODE": + case 3: + message.labelDetectionMode = 3; + break; + } + if (object.stationaryCamera != null) + message.stationaryCamera = Boolean(object.stationaryCamera); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig} message LabelDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelDetectionMode = options.enums === String ? "LABEL_DETECTION_MODE_UNSPECIFIED" : 0; + object.stationaryCamera = false; + object.model = ""; + } + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + object.labelDetectionMode = options.enums === String ? $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionMode[message.labelDetectionMode] === undefined ? message.labelDetectionMode : $root.google.cloud.videointelligence.v1p1beta1.LabelDetectionMode[message.labelDetectionMode] : message.labelDetectionMode; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + object.stationaryCamera = message.stationaryCamera; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + LabelDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig"; + }; + + return LabelDetectionConfig; + })(); + + v1p1beta1.ShotChangeDetectionConfig = (function() { + + /** + * Properties of a ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IShotChangeDetectionConfig + * @property {string|null} [model] ShotChangeDetectionConfig model + */ + + /** + * Constructs a new ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a ShotChangeDetectionConfig. + * @implements IShotChangeDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig=} [properties] Properties to set + */ + function ShotChangeDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShotChangeDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @instance + */ + ShotChangeDetectionConfig.prototype.model = ""; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig instance + */ + ShotChangeDetectionConfig.create = function create(properties) { + return new ShotChangeDetectionConfig(properties); + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decode = function 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.videointelligence.v1p1beta1.ShotChangeDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShotChangeDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + */ + ShotChangeDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig} message ShotChangeDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShotChangeDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ShotChangeDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShotChangeDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig"; + }; + + return ShotChangeDetectionConfig; + })(); + + v1p1beta1.ExplicitContentDetectionConfig = (function() { + + /** + * Properties of an ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IExplicitContentDetectionConfig + * @property {string|null} [model] ExplicitContentDetectionConfig model + */ + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an ExplicitContentDetectionConfig. + * @implements IExplicitContentDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig=} [properties] Properties to set + */ + function ExplicitContentDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @instance + */ + ExplicitContentDetectionConfig.prototype.model = ""; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig instance + */ + ExplicitContentDetectionConfig.create = function create(properties) { + return new ExplicitContentDetectionConfig(properties); + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decode = function 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.videointelligence.v1p1beta1.ExplicitContentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + */ + ExplicitContentDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} message ExplicitContentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig"; + }; + + return ExplicitContentDetectionConfig; + })(); + + v1p1beta1.VideoSegment = (function() { + + /** + * Properties of a VideoSegment. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IVideoSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] VideoSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] VideoSegment endTimeOffset + */ + + /** + * Constructs a new VideoSegment. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a VideoSegment. + * @implements IVideoSegment + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IVideoSegment=} [properties] Properties to set + */ + function VideoSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @instance + */ + VideoSegment.prototype.startTimeOffset = null; + + /** + * VideoSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @instance + */ + VideoSegment.prototype.endTimeOffset = null; + + /** + * Creates a new VideoSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.VideoSegment} VideoSegment instance + */ + VideoSegment.create = function create(properties) { + return new VideoSegment(properties); + }; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.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(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decode = function 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.videointelligence.v1p1beta1.VideoSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoSegment.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; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.VideoSegment} VideoSegment + */ + VideoSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.VideoSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.VideoSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoSegment.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.videointelligence.v1p1beta1.VideoSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.VideoSegment} message VideoSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeOffset = null; + object.endTimeOffset = null; + } + 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 VideoSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @instance + * @returns {Object.} JSON object + */ + VideoSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.VideoSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.VideoSegment"; + }; + + return VideoSegment; + })(); + + v1p1beta1.LabelSegment = (function() { + + /** + * Properties of a LabelSegment. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ILabelSegment + * @property {google.cloud.videointelligence.v1p1beta1.IVideoSegment|null} [segment] LabelSegment segment + * @property {number|null} [confidence] LabelSegment confidence + */ + + /** + * Constructs a new LabelSegment. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a LabelSegment. + * @implements ILabelSegment + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ILabelSegment=} [properties] Properties to set + */ + function LabelSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelSegment segment. + * @member {google.cloud.videointelligence.v1p1beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @instance + */ + LabelSegment.prototype.segment = null; + + /** + * LabelSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @instance + */ + LabelSegment.prototype.confidence = 0; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.LabelSegment} LabelSegment instance + */ + LabelSegment.create = function create(properties) { + return new LabelSegment(properties); + }; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decode = function 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.videointelligence.v1p1beta1.LabelSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.LabelSegment} LabelSegment + */ + LabelSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.LabelSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.LabelSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p1beta1.LabelSegment} message LabelSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @instance + * @returns {Object.} JSON object + */ + LabelSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.LabelSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.LabelSegment"; + }; + + return LabelSegment; + })(); + + v1p1beta1.LabelFrame = (function() { + + /** + * Properties of a LabelFrame. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ILabelFrame + * @property {google.protobuf.IDuration|null} [timeOffset] LabelFrame timeOffset + * @property {number|null} [confidence] LabelFrame confidence + */ + + /** + * Constructs a new LabelFrame. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a LabelFrame. + * @implements ILabelFrame + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ILabelFrame=} [properties] Properties to set + */ + function LabelFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @instance + */ + LabelFrame.prototype.timeOffset = null; + + /** + * LabelFrame confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @instance + */ + LabelFrame.prototype.confidence = 0; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.LabelFrame} LabelFrame instance + */ + LabelFrame.create = function create(properties) { + return new LabelFrame(properties); + }; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decode = function 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.videointelligence.v1p1beta1.LabelFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.LabelFrame} LabelFrame + */ + LabelFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.LabelFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.LabelFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.LabelFrame} message LabelFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.confidence = 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @instance + * @returns {Object.} JSON object + */ + LabelFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.LabelFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.LabelFrame"; + }; + + return LabelFrame; + })(); + + v1p1beta1.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IEntity + * @property {string|null} [entityId] Entity entityId + * @property {string|null} [description] Entity description + * @property {string|null} [languageCode] Entity languageCode + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity entityId. + * @member {string} entityId + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @instance + */ + Entity.prototype.entityId = ""; + + /** + * Entity description. + * @member {string} description + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @instance + */ + Entity.prototype.description = ""; + + /** + * Entity languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @instance + */ + Entity.prototype.languageCode = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IEntity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function 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.videointelligence.v1p1beta1.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.Entity) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.Entity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p1beta1.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.description = ""; + object.languageCode = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.Entity"; + }; + + return Entity; + })(); + + v1p1beta1.LabelAnnotation = (function() { + + /** + * Properties of a LabelAnnotation. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ILabelAnnotation + * @property {google.cloud.videointelligence.v1p1beta1.IEntity|null} [entity] LabelAnnotation entity + * @property {Array.|null} [categoryEntities] LabelAnnotation categoryEntities + * @property {Array.|null} [segments] LabelAnnotation segments + * @property {Array.|null} [frames] LabelAnnotation frames + */ + + /** + * Constructs a new LabelAnnotation. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a LabelAnnotation. + * @implements ILabelAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ILabelAnnotation=} [properties] Properties to set + */ + function LabelAnnotation(properties) { + this.categoryEntities = []; + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelAnnotation entity. + * @member {google.cloud.videointelligence.v1p1beta1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.entity = null; + + /** + * LabelAnnotation categoryEntities. + * @member {Array.} categoryEntities + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.categoryEntities = $util.emptyArray; + + /** + * LabelAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.segments = $util.emptyArray; + + /** + * LabelAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.LabelAnnotation} LabelAnnotation instance + */ + LabelAnnotation.create = function create(properties) { + return new LabelAnnotation(properties); + }; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1p1beta1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.categoryEntities != null && message.categoryEntities.length) + for (var i = 0; i < message.categoryEntities.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.Entity.encode(message.categoryEntities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.LabelSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.LabelFrame.encode(message.frames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decode = function 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.videointelligence.v1p1beta1.LabelAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1p1beta1.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.categoryEntities && message.categoryEntities.length)) + message.categoryEntities = []; + message.categoryEntities.push($root.google.cloud.videointelligence.v1p1beta1.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p1beta1.LabelSegment.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p1beta1.LabelFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.categoryEntities != null && message.hasOwnProperty("categoryEntities")) { + if (!Array.isArray(message.categoryEntities)) + return "categoryEntities: array expected"; + for (var i = 0; i < message.categoryEntities.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.Entity.verify(message.categoryEntities[i]); + if (error) + return "categoryEntities." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.LabelSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.LabelFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.LabelAnnotation} LabelAnnotation + */ + LabelAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1p1beta1.Entity.fromObject(object.entity); + } + if (object.categoryEntities) { + if (!Array.isArray(object.categoryEntities)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.categoryEntities: array expected"); + message.categoryEntities = []; + for (var i = 0; i < object.categoryEntities.length; ++i) { + if (typeof object.categoryEntities[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.categoryEntities: object expected"); + message.categoryEntities[i] = $root.google.cloud.videointelligence.v1p1beta1.Entity.fromObject(object.categoryEntities[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p1beta1.LabelSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.LabelAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p1beta1.LabelFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.LabelAnnotation} message LabelAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categoryEntities = []; + object.segments = []; + object.frames = []; + } + if (options.defaults) + object.entity = null; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1p1beta1.Entity.toObject(message.entity, options); + if (message.categoryEntities && message.categoryEntities.length) { + object.categoryEntities = []; + for (var j = 0; j < message.categoryEntities.length; ++j) + object.categoryEntities[j] = $root.google.cloud.videointelligence.v1p1beta1.Entity.toObject(message.categoryEntities[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p1beta1.LabelSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p1beta1.LabelFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this LabelAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @instance + * @returns {Object.} JSON object + */ + LabelAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.LabelAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.LabelAnnotation"; + }; + + return LabelAnnotation; + })(); + + v1p1beta1.ExplicitContentFrame = (function() { + + /** + * Properties of an ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IExplicitContentFrame + * @property {google.protobuf.IDuration|null} [timeOffset] ExplicitContentFrame timeOffset + * @property {google.cloud.videointelligence.v1p1beta1.Likelihood|null} [pornographyLikelihood] ExplicitContentFrame pornographyLikelihood + */ + + /** + * Constructs a new ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an ExplicitContentFrame. + * @implements IExplicitContentFrame + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame=} [properties] Properties to set + */ + function ExplicitContentFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.timeOffset = null; + + /** + * ExplicitContentFrame pornographyLikelihood. + * @member {google.cloud.videointelligence.v1p1beta1.Likelihood} pornographyLikelihood + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.pornographyLikelihood = 0; + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame} ExplicitContentFrame instance + */ + ExplicitContentFrame.create = function create(properties) { + return new ExplicitContentFrame(properties); + }; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pornographyLikelihood != null && Object.hasOwnProperty.call(message, "pornographyLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pornographyLikelihood); + return writer; + }; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decode = function 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.videointelligence.v1p1beta1.ExplicitContentFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pornographyLikelihood = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + switch (message.pornographyLikelihood) { + default: + return "pornographyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame} ExplicitContentFrame + */ + ExplicitContentFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + switch (object.pornographyLikelihood) { + default: + if (typeof object.pornographyLikelihood === "number") { + message.pornographyLikelihood = object.pornographyLikelihood; + break; + } + break; + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.pornographyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.pornographyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.pornographyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.pornographyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.pornographyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.pornographyLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame} message ExplicitContentFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.pornographyLikelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + object.pornographyLikelihood = options.enums === String ? $root.google.cloud.videointelligence.v1p1beta1.Likelihood[message.pornographyLikelihood] === undefined ? message.pornographyLikelihood : $root.google.cloud.videointelligence.v1p1beta1.Likelihood[message.pornographyLikelihood] : message.pornographyLikelihood; + return object; + }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame"; + }; + + return ExplicitContentFrame; + })(); + + v1p1beta1.ExplicitContentAnnotation = (function() { + + /** + * Properties of an ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IExplicitContentAnnotation + * @property {Array.|null} [frames] ExplicitContentAnnotation frames + */ + + /** + * Constructs a new ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an ExplicitContentAnnotation. + * @implements IExplicitContentAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation=} [properties] Properties to set + */ + function ExplicitContentAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @instance + */ + ExplicitContentAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation} ExplicitContentAnnotation instance + */ + ExplicitContentAnnotation.create = function create(properties) { + return new ExplicitContentAnnotation(properties); + }; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.encode(message.frames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decode = function 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.videointelligence.v1p1beta1.ExplicitContentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates an ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + */ + ExplicitContentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation(); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation} message ExplicitContentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation"; + }; + + return ExplicitContentAnnotation; + })(); + + v1p1beta1.VideoAnnotationResults = (function() { + + /** + * Properties of a VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IVideoAnnotationResults + * @property {string|null} [inputUri] VideoAnnotationResults inputUri + * @property {Array.|null} [segmentLabelAnnotations] VideoAnnotationResults segmentLabelAnnotations + * @property {Array.|null} [shotLabelAnnotations] VideoAnnotationResults shotLabelAnnotations + * @property {Array.|null} [frameLabelAnnotations] VideoAnnotationResults frameLabelAnnotations + * @property {Array.|null} [shotAnnotations] VideoAnnotationResults shotAnnotations + * @property {google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation|null} [explicitAnnotation] VideoAnnotationResults explicitAnnotation + * @property {Array.|null} [speechTranscriptions] VideoAnnotationResults speechTranscriptions + * @property {google.rpc.IStatus|null} [error] VideoAnnotationResults error + */ + + /** + * Constructs a new VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a VideoAnnotationResults. + * @implements IVideoAnnotationResults + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults=} [properties] Properties to set + */ + function VideoAnnotationResults(properties) { + this.segmentLabelAnnotations = []; + this.shotLabelAnnotations = []; + this.frameLabelAnnotations = []; + this.shotAnnotations = []; + this.speechTranscriptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationResults inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.inputUri = ""; + + /** + * VideoAnnotationResults segmentLabelAnnotations. + * @member {Array.} segmentLabelAnnotations + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotLabelAnnotations. + * @member {Array.} shotLabelAnnotations + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults frameLabelAnnotations. + * @member {Array.} frameLabelAnnotations + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.frameLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotAnnotations. + * @member {Array.} shotAnnotations + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults explicitAnnotation. + * @member {google.cloud.videointelligence.v1p1beta1.IExplicitContentAnnotation|null|undefined} explicitAnnotation + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.explicitAnnotation = null; + + /** + * VideoAnnotationResults speechTranscriptions. + * @member {Array.} speechTranscriptions + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.speechTranscriptions = $util.emptyArray; + + /** + * VideoAnnotationResults error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.error = null; + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults} VideoAnnotationResults instance + */ + VideoAnnotationResults.create = function create(properties) { + return new VideoAnnotationResults(properties); + }; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.segmentLabelAnnotations != null && message.segmentLabelAnnotations.length) + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.encode(message.segmentLabelAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotLabelAnnotations != null && message.shotLabelAnnotations.length) + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.encode(message.shotLabelAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frameLabelAnnotations != null && message.frameLabelAnnotations.length) + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.encode(message.frameLabelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.shotAnnotations != null && message.shotAnnotations.length) + for (var i = 0; i < message.shotAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.encode(message.shotAnnotations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.explicitAnnotation != null && Object.hasOwnProperty.call(message, "explicitAnnotation")) + $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.encode(message.explicitAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.speechTranscriptions != null && message.speechTranscriptions.length) + for (var i = 0; i < message.speechTranscriptions.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription.encode(message.speechTranscriptions[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decode = function 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.videointelligence.v1p1beta1.VideoAnnotationResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + if (!(message.segmentLabelAnnotations && message.segmentLabelAnnotations.length)) + message.segmentLabelAnnotations = []; + message.segmentLabelAnnotations.push($root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.shotLabelAnnotations && message.shotLabelAnnotations.length)) + message.shotLabelAnnotations = []; + message.shotLabelAnnotations.push($root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frameLabelAnnotations && message.frameLabelAnnotations.length)) + message.frameLabelAnnotations = []; + message.frameLabelAnnotations.push($root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.shotAnnotations && message.shotAnnotations.length)) + message.shotAnnotations = []; + message.shotAnnotations.push($root.google.cloud.videointelligence.v1p1beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.speechTranscriptions && message.speechTranscriptions.length)) + message.speechTranscriptions = []; + message.speechTranscriptions.push($root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription.decode(reader, reader.uint32())); + break; + } + case 9: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationResults message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.segmentLabelAnnotations != null && message.hasOwnProperty("segmentLabelAnnotations")) { + if (!Array.isArray(message.segmentLabelAnnotations)) + return "segmentLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify(message.segmentLabelAnnotations[i]); + if (error) + return "segmentLabelAnnotations." + error; + } + } + if (message.shotLabelAnnotations != null && message.hasOwnProperty("shotLabelAnnotations")) { + if (!Array.isArray(message.shotLabelAnnotations)) + return "shotLabelAnnotations: array expected"; + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify(message.shotLabelAnnotations[i]); + if (error) + return "shotLabelAnnotations." + error; + } + } + if (message.frameLabelAnnotations != null && message.hasOwnProperty("frameLabelAnnotations")) { + if (!Array.isArray(message.frameLabelAnnotations)) + return "frameLabelAnnotations: array expected"; + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.verify(message.frameLabelAnnotations[i]); + if (error) + return "frameLabelAnnotations." + error; + } + } + if (message.shotAnnotations != null && message.hasOwnProperty("shotAnnotations")) { + if (!Array.isArray(message.shotAnnotations)) + return "shotAnnotations: array expected"; + for (var i = 0; i < message.shotAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.verify(message.shotAnnotations[i]); + if (error) + return "shotAnnotations." + error; + } + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) { + var error = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.verify(message.explicitAnnotation); + if (error) + return "explicitAnnotation." + error; + } + if (message.speechTranscriptions != null && message.hasOwnProperty("speechTranscriptions")) { + if (!Array.isArray(message.speechTranscriptions)) + return "speechTranscriptions: array expected"; + for (var i = 0; i < message.speechTranscriptions.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription.verify(message.speechTranscriptions[i]); + if (error) + return "speechTranscriptions." + error; + } + } + 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 VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults} VideoAnnotationResults + */ + VideoAnnotationResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.segmentLabelAnnotations) { + if (!Array.isArray(object.segmentLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.segmentLabelAnnotations: array expected"); + message.segmentLabelAnnotations = []; + for (var i = 0; i < object.segmentLabelAnnotations.length; ++i) { + if (typeof object.segmentLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.segmentLabelAnnotations: object expected"); + message.segmentLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.fromObject(object.segmentLabelAnnotations[i]); + } + } + if (object.shotLabelAnnotations) { + if (!Array.isArray(object.shotLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.shotLabelAnnotations: array expected"); + message.shotLabelAnnotations = []; + for (var i = 0; i < object.shotLabelAnnotations.length; ++i) { + if (typeof object.shotLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.shotLabelAnnotations: object expected"); + message.shotLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.fromObject(object.shotLabelAnnotations[i]); + } + } + if (object.frameLabelAnnotations) { + if (!Array.isArray(object.frameLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.frameLabelAnnotations: array expected"); + message.frameLabelAnnotations = []; + for (var i = 0; i < object.frameLabelAnnotations.length; ++i) { + if (typeof object.frameLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.frameLabelAnnotations: object expected"); + message.frameLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.fromObject(object.frameLabelAnnotations[i]); + } + } + if (object.shotAnnotations) { + if (!Array.isArray(object.shotAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.shotAnnotations: array expected"); + message.shotAnnotations = []; + for (var i = 0; i < object.shotAnnotations.length; ++i) { + if (typeof object.shotAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.shotAnnotations: object expected"); + message.shotAnnotations[i] = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.fromObject(object.shotAnnotations[i]); + } + } + if (object.explicitAnnotation != null) { + if (typeof object.explicitAnnotation !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.explicitAnnotation: object expected"); + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.fromObject(object.explicitAnnotation); + } + if (object.speechTranscriptions) { + if (!Array.isArray(object.speechTranscriptions)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.speechTranscriptions: array expected"); + message.speechTranscriptions = []; + for (var i = 0; i < object.speechTranscriptions.length; ++i) { + if (typeof object.speechTranscriptions[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.speechTranscriptions: object expected"); + message.speechTranscriptions[i] = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription.fromObject(object.speechTranscriptions[i]); + } + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults} message VideoAnnotationResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segmentLabelAnnotations = []; + object.shotLabelAnnotations = []; + object.frameLabelAnnotations = []; + object.shotAnnotations = []; + object.speechTranscriptions = []; + } + if (options.defaults) { + object.inputUri = ""; + object.explicitAnnotation = null; + object.error = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.segmentLabelAnnotations && message.segmentLabelAnnotations.length) { + object.segmentLabelAnnotations = []; + for (var j = 0; j < message.segmentLabelAnnotations.length; ++j) + object.segmentLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.toObject(message.segmentLabelAnnotations[j], options); + } + if (message.shotLabelAnnotations && message.shotLabelAnnotations.length) { + object.shotLabelAnnotations = []; + for (var j = 0; j < message.shotLabelAnnotations.length; ++j) + object.shotLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.toObject(message.shotLabelAnnotations[j], options); + } + if (message.frameLabelAnnotations && message.frameLabelAnnotations.length) { + object.frameLabelAnnotations = []; + for (var j = 0; j < message.frameLabelAnnotations.length; ++j) + object.frameLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p1beta1.LabelAnnotation.toObject(message.frameLabelAnnotations[j], options); + } + if (message.shotAnnotations && message.shotAnnotations.length) { + object.shotAnnotations = []; + for (var j = 0; j < message.shotAnnotations.length; ++j) + object.shotAnnotations[j] = $root.google.cloud.videointelligence.v1p1beta1.VideoSegment.toObject(message.shotAnnotations[j], options); + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) + object.explicitAnnotation = $root.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.toObject(message.explicitAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.speechTranscriptions && message.speechTranscriptions.length) { + object.speechTranscriptions = []; + for (var j = 0; j < message.speechTranscriptions.length; ++j) + object.speechTranscriptions[j] = $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription.toObject(message.speechTranscriptions[j], options); + } + return object; + }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationResults + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults"; + }; + + return VideoAnnotationResults; + })(); + + v1p1beta1.AnnotateVideoResponse = (function() { + + /** + * Properties of an AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IAnnotateVideoResponse + * @property {Array.|null} [annotationResults] AnnotateVideoResponse annotationResults + */ + + /** + * Constructs a new AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an AnnotateVideoResponse. + * @implements IAnnotateVideoResponse + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse=} [properties] Properties to set + */ + function AnnotateVideoResponse(properties) { + this.annotationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoResponse annotationResults. + * @member {Array.} annotationResults + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @instance + */ + AnnotateVideoResponse.prototype.annotationResults = $util.emptyArray; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse} AnnotateVideoResponse instance + */ + AnnotateVideoResponse.create = function create(properties) { + return new AnnotateVideoResponse(properties); + }; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationResults != null && message.annotationResults.length) + for (var i = 0; i < message.annotationResults.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.encode(message.annotationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decode = function 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.videointelligence.v1p1beta1.AnnotateVideoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationResults && message.annotationResults.length)) + message.annotationResults = []; + message.annotationResults.push($root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoResponse message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) { + if (!Array.isArray(message.annotationResults)) + return "annotationResults: array expected"; + for (var i = 0; i < message.annotationResults.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.verify(message.annotationResults[i]); + if (error) + return "annotationResults." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse} AnnotateVideoResponse + */ + AnnotateVideoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse(); + if (object.annotationResults) { + if (!Array.isArray(object.annotationResults)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.annotationResults: array expected"); + message.annotationResults = []; + for (var i = 0; i < object.annotationResults.length; ++i) { + if (typeof object.annotationResults[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.annotationResults: object expected"); + message.annotationResults[i] = $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.fromObject(object.annotationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse} message AnnotateVideoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationResults = []; + if (message.annotationResults && message.annotationResults.length) { + object.annotationResults = []; + for (var j = 0; j < message.annotationResults.length; ++j) + object.annotationResults[j] = $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.toObject(message.annotationResults[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse"; + }; + + return AnnotateVideoResponse; + })(); + + v1p1beta1.VideoAnnotationProgress = (function() { + + /** + * Properties of a VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IVideoAnnotationProgress + * @property {string|null} [inputUri] VideoAnnotationProgress inputUri + * @property {number|null} [progressPercent] VideoAnnotationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] VideoAnnotationProgress startTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VideoAnnotationProgress updateTime + */ + + /** + * Constructs a new VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a VideoAnnotationProgress. + * @implements IVideoAnnotationProgress + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress=} [properties] Properties to set + */ + function VideoAnnotationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationProgress inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.inputUri = ""; + + /** + * VideoAnnotationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.progressPercent = 0; + + /** + * VideoAnnotationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.startTime = null; + + /** + * VideoAnnotationProgress updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.updateTime = null; + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress} VideoAnnotationProgress instance + */ + VideoAnnotationProgress.create = function create(properties) { + return new VideoAnnotationProgress(properties); + }; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decode = function 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.videointelligence.v1p1beta1.VideoAnnotationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.progressPercent = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress} VideoAnnotationProgress + */ + VideoAnnotationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress} message VideoAnnotationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.progressPercent = 0; + object.startTime = null; + object.updateTime = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress"; + }; + + return VideoAnnotationProgress; + })(); + + v1p1beta1.AnnotateVideoProgress = (function() { + + /** + * Properties of an AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IAnnotateVideoProgress + * @property {Array.|null} [annotationProgress] AnnotateVideoProgress annotationProgress + */ + + /** + * Constructs a new AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents an AnnotateVideoProgress. + * @implements IAnnotateVideoProgress + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress=} [properties] Properties to set + */ + function AnnotateVideoProgress(properties) { + this.annotationProgress = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoProgress annotationProgress. + * @member {Array.} annotationProgress + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @instance + */ + AnnotateVideoProgress.prototype.annotationProgress = $util.emptyArray; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress} AnnotateVideoProgress instance + */ + AnnotateVideoProgress.create = function create(properties) { + return new AnnotateVideoProgress(properties); + }; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationProgress != null && message.annotationProgress.length) + for (var i = 0; i < message.annotationProgress.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.encode(message.annotationProgress[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decode = function 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.videointelligence.v1p1beta1.AnnotateVideoProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationProgress && message.annotationProgress.length)) + message.annotationProgress = []; + message.annotationProgress.push($root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationProgress != null && message.hasOwnProperty("annotationProgress")) { + if (!Array.isArray(message.annotationProgress)) + return "annotationProgress: array expected"; + for (var i = 0; i < message.annotationProgress.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.verify(message.annotationProgress[i]); + if (error) + return "annotationProgress." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress} AnnotateVideoProgress + */ + AnnotateVideoProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress(); + if (object.annotationProgress) { + if (!Array.isArray(object.annotationProgress)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.annotationProgress: array expected"); + message.annotationProgress = []; + for (var i = 0; i < object.annotationProgress.length; ++i) { + if (typeof object.annotationProgress[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.annotationProgress: object expected"); + message.annotationProgress[i] = $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.fromObject(object.annotationProgress[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress} message AnnotateVideoProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationProgress = []; + if (message.annotationProgress && message.annotationProgress.length) { + object.annotationProgress = []; + for (var j = 0; j < message.annotationProgress.length; ++j) + object.annotationProgress[j] = $root.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.toObject(message.annotationProgress[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress"; + }; + + return AnnotateVideoProgress; + })(); + + v1p1beta1.SpeechTranscriptionConfig = (function() { + + /** + * Properties of a SpeechTranscriptionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ISpeechTranscriptionConfig + * @property {string|null} [languageCode] SpeechTranscriptionConfig languageCode + * @property {number|null} [maxAlternatives] SpeechTranscriptionConfig maxAlternatives + * @property {boolean|null} [filterProfanity] SpeechTranscriptionConfig filterProfanity + * @property {Array.|null} [speechContexts] SpeechTranscriptionConfig speechContexts + * @property {boolean|null} [enableAutomaticPunctuation] SpeechTranscriptionConfig enableAutomaticPunctuation + * @property {Array.|null} [audioTracks] SpeechTranscriptionConfig audioTracks + */ + + /** + * Constructs a new SpeechTranscriptionConfig. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a SpeechTranscriptionConfig. + * @implements ISpeechTranscriptionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig=} [properties] Properties to set + */ + function SpeechTranscriptionConfig(properties) { + this.speechContexts = []; + this.audioTracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechTranscriptionConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.languageCode = ""; + + /** + * SpeechTranscriptionConfig maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.maxAlternatives = 0; + + /** + * SpeechTranscriptionConfig filterProfanity. + * @member {boolean} filterProfanity + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.filterProfanity = false; + + /** + * SpeechTranscriptionConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.speechContexts = $util.emptyArray; + + /** + * SpeechTranscriptionConfig enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableAutomaticPunctuation = false; + + /** + * SpeechTranscriptionConfig audioTracks. + * @member {Array.} audioTracks + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.audioTracks = $util.emptyArray; + + /** + * Creates a new SpeechTranscriptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig instance + */ + SpeechTranscriptionConfig.create = function create(properties) { + return new SpeechTranscriptionConfig(properties); + }; + + /** + * Encodes the specified SpeechTranscriptionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig} message SpeechTranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscriptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxAlternatives); + if (message.filterProfanity != null && Object.hasOwnProperty.call(message, "filterProfanity")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.filterProfanity); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableAutomaticPunctuation); + if (message.audioTracks != null && message.audioTracks.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.audioTracks.length; ++i) + writer.int32(message.audioTracks[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SpeechTranscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscriptionConfig} message SpeechTranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscriptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscriptionConfig.decode = function 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.videointelligence.v1p1beta1.SpeechTranscriptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.maxAlternatives = reader.int32(); + break; + } + case 3: { + message.filterProfanity = reader.bool(); + break; + } + case 4: { + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.videointelligence.v1p1beta1.SpeechContext.decode(reader, reader.uint32())); + break; + } + case 5: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 6: { + if (!(message.audioTracks && message.audioTracks.length)) + message.audioTracks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.audioTracks.push(reader.int32()); + } else + message.audioTracks.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscriptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechTranscriptionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechTranscriptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + if (message.filterProfanity != null && message.hasOwnProperty("filterProfanity")) + if (typeof message.filterProfanity !== "boolean") + return "filterProfanity: boolean expected"; + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.audioTracks != null && message.hasOwnProperty("audioTracks")) { + if (!Array.isArray(message.audioTracks)) + return "audioTracks: array expected"; + for (var i = 0; i < message.audioTracks.length; ++i) + if (!$util.isInteger(message.audioTracks[i])) + return "audioTracks: integer[] expected"; + } + return null; + }; + + /** + * Creates a SpeechTranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + */ + SpeechTranscriptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + if (object.filterProfanity != null) + message.filterProfanity = Boolean(object.filterProfanity); + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.videointelligence.v1p1beta1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.audioTracks) { + if (!Array.isArray(object.audioTracks)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.audioTracks: array expected"); + message.audioTracks = []; + for (var i = 0; i < object.audioTracks.length; ++i) + message.audioTracks[i] = object.audioTracks[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a SpeechTranscriptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig} message SpeechTranscriptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechTranscriptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechContexts = []; + object.audioTracks = []; + } + if (options.defaults) { + object.languageCode = ""; + object.maxAlternatives = 0; + object.filterProfanity = false; + object.enableAutomaticPunctuation = false; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.filterProfanity != null && message.hasOwnProperty("filterProfanity")) + object.filterProfanity = message.filterProfanity; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.videointelligence.v1p1beta1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.audioTracks && message.audioTracks.length) { + object.audioTracks = []; + for (var j = 0; j < message.audioTracks.length; ++j) + object.audioTracks[j] = message.audioTracks[j]; + } + return object; + }; + + /** + * Converts this SpeechTranscriptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechTranscriptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechTranscriptionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechTranscriptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig"; + }; + + return SpeechTranscriptionConfig; + })(); + + v1p1beta1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function 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.videointelligence.v1p1beta1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.SpeechContext) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p1beta1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.SpeechContext"; + }; + + return SpeechContext; + })(); + + v1p1beta1.SpeechTranscription = (function() { + + /** + * Properties of a SpeechTranscription. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ISpeechTranscription + * @property {Array.|null} [alternatives] SpeechTranscription alternatives + */ + + /** + * Constructs a new SpeechTranscription. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a SpeechTranscription. + * @implements ISpeechTranscription + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscription=} [properties] Properties to set + */ + function SpeechTranscription(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechTranscription alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @instance + */ + SpeechTranscription.prototype.alternatives = $util.emptyArray; + + /** + * Creates a new SpeechTranscription instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscription=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscription} SpeechTranscription instance + */ + SpeechTranscription.create = function create(properties) { + return new SpeechTranscription(properties); + }; + + /** + * Encodes the specified SpeechTranscription message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscription.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscription} message SpeechTranscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechTranscription message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechTranscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechTranscription} message SpeechTranscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscription} SpeechTranscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscription.decode = function 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.videointelligence.v1p1beta1.SpeechTranscription(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscription} SpeechTranscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechTranscription message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechTranscription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + return null; + }; + + /** + * Creates a SpeechTranscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechTranscription} SpeechTranscription + */ + SpeechTranscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.SpeechTranscription(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechTranscription.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechTranscription.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechTranscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p1beta1.SpeechTranscription} message SpeechTranscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechTranscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + return object; + }; + + /** + * Converts this SpeechTranscription to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @instance + * @returns {Object.} JSON object + */ + SpeechTranscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechTranscription + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechTranscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechTranscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.SpeechTranscription"; + }; + + return SpeechTranscription; + })(); + + v1p1beta1.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.videointelligence.v1p1beta1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function 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.videointelligence.v1p1beta1.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.videointelligence.v1p1beta1.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p1beta1.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.videointelligence.v1p1beta1.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.videointelligence.v1p1beta1.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v1p1beta1.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime + * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime + * @property {string|null} [word] WordInfo word + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.videointelligence.v1p1beta1 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.videointelligence.v1p1beta1.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startTime. + * @member {google.protobuf.IDuration|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.startTime = null; + + /** + * WordInfo endTime. + * @member {google.protobuf.IDuration|null|undefined} endTime + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.endTime = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p1beta1.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p1beta1.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p1beta1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function 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.videointelligence.v1p1beta1.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p1beta1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Duration.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Duration.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p1beta1.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p1beta1.WordInfo) + return object; + var message = new $root.google.cloud.videointelligence.v1p1beta1.WordInfo(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.WordInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p1beta1.WordInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime); + } + if (object.word != null) + message.word = String(object.word); + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p1beta1.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.word = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p1beta1.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p1beta1.WordInfo"; + }; + + return WordInfo; + })(); + + /** + * Feature enum. + * @name google.cloud.videointelligence.v1p1beta1.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} LABEL_DETECTION=1 LABEL_DETECTION value + * @property {number} SHOT_CHANGE_DETECTION=2 SHOT_CHANGE_DETECTION value + * @property {number} EXPLICIT_CONTENT_DETECTION=3 EXPLICIT_CONTENT_DETECTION value + * @property {number} SPEECH_TRANSCRIPTION=6 SPEECH_TRANSCRIPTION value + */ + v1p1beta1.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LABEL_DETECTION"] = 1; + values[valuesById[2] = "SHOT_CHANGE_DETECTION"] = 2; + values[valuesById[3] = "EXPLICIT_CONTENT_DETECTION"] = 3; + values[valuesById[6] = "SPEECH_TRANSCRIPTION"] = 6; + return values; + })(); + + /** + * LabelDetectionMode enum. + * @name google.cloud.videointelligence.v1p1beta1.LabelDetectionMode + * @enum {number} + * @property {number} LABEL_DETECTION_MODE_UNSPECIFIED=0 LABEL_DETECTION_MODE_UNSPECIFIED value + * @property {number} SHOT_MODE=1 SHOT_MODE value + * @property {number} FRAME_MODE=2 FRAME_MODE value + * @property {number} SHOT_AND_FRAME_MODE=3 SHOT_AND_FRAME_MODE value + */ + v1p1beta1.LabelDetectionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LABEL_DETECTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOT_MODE"] = 1; + values[valuesById[2] = "FRAME_MODE"] = 2; + values[valuesById[3] = "SHOT_AND_FRAME_MODE"] = 3; + return values; + })(); + + /** + * Likelihood enum. + * @name google.cloud.videointelligence.v1p1beta1.Likelihood + * @enum {number} + * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p1beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + return v1p1beta1; + })(); + + videointelligence.v1p2beta1 = (function() { + + /** + * Namespace v1p2beta1. + * @memberof google.cloud.videointelligence + * @namespace + */ + var v1p2beta1 = {}; + + v1p2beta1.VideoIntelligenceService = (function() { + + /** + * Constructs a new VideoIntelligenceService service. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a VideoIntelligenceService + * @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 VideoIntelligenceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VideoIntelligenceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoIntelligenceService; + + /** + * Creates new VideoIntelligenceService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService + * @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 {VideoIntelligenceService} RPC service. Useful where requests and/or responses are streamed. + */ + VideoIntelligenceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService|annotateVideo}. + * @memberof google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService + * @typedef AnnotateVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @param {google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService.AnnotateVideoCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoIntelligenceService.prototype.annotateVideo = function annotateVideo(request, callback) { + return this.rpcCall(annotateVideo, $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnnotateVideo" }); + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VideoIntelligenceService; + })(); + + v1p2beta1.AnnotateVideoRequest = (function() { + + /** + * Properties of an AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IAnnotateVideoRequest + * @property {string|null} [inputUri] AnnotateVideoRequest inputUri + * @property {Uint8Array|null} [inputContent] AnnotateVideoRequest inputContent + * @property {Array.|null} [features] AnnotateVideoRequest features + * @property {google.cloud.videointelligence.v1p2beta1.IVideoContext|null} [videoContext] AnnotateVideoRequest videoContext + * @property {string|null} [outputUri] AnnotateVideoRequest outputUri + * @property {string|null} [locationId] AnnotateVideoRequest locationId + */ + + /** + * Constructs a new AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an AnnotateVideoRequest. + * @implements IAnnotateVideoRequest + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest=} [properties] Properties to set + */ + function AnnotateVideoRequest(properties) { + this.features = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoRequest inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputUri = ""; + + /** + * AnnotateVideoRequest inputContent. + * @member {Uint8Array} inputContent + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputContent = $util.newBuffer([]); + + /** + * AnnotateVideoRequest features. + * @member {Array.} features + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateVideoRequest videoContext. + * @member {google.cloud.videointelligence.v1p2beta1.IVideoContext|null|undefined} videoContext + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.videoContext = null; + + /** + * AnnotateVideoRequest outputUri. + * @member {string} outputUri + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.outputUri = ""; + + /** + * AnnotateVideoRequest locationId. + * @member {string} locationId + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.locationId = ""; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} AnnotateVideoRequest instance + */ + AnnotateVideoRequest.create = function create(properties) { + return new AnnotateVideoRequest(properties); + }; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.features != null && message.features.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.features.length; ++i) + writer.int32(message.features[i]); + writer.ldelim(); + } + if (message.videoContext != null && Object.hasOwnProperty.call(message, "videoContext")) + $root.google.cloud.videointelligence.v1p2beta1.VideoContext.encode(message.videoContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUri); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + if (message.inputContent != null && Object.hasOwnProperty.call(message, "inputContent")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputContent); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decode = function 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.videointelligence.v1p2beta1.AnnotateVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 6: { + message.inputContent = reader.bytes(); + break; + } + case 2: { + if (!(message.features && message.features.length)) + message.features = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.features.push(reader.int32()); + } else + message.features.push(reader.int32()); + break; + } + case 3: { + message.videoContext = $root.google.cloud.videointelligence.v1p2beta1.VideoContext.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputUri = reader.string(); + break; + } + case 5: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoRequest message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + if (!(message.inputContent && typeof message.inputContent.length === "number" || $util.isString(message.inputContent))) + return "inputContent: buffer expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + switch (message.features[i]) { + default: + return "features: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 7: + case 9: + break; + } + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoContext.verify(message.videoContext); + if (error) + return "videoContext." + error; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates an AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} AnnotateVideoRequest + */ + AnnotateVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.inputContent != null) + if (typeof object.inputContent === "string") + $util.base64.decode(object.inputContent, message.inputContent = $util.newBuffer($util.base64.length(object.inputContent)), 0); + else if (object.inputContent.length >= 0) + message.inputContent = object.inputContent; + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + switch (object.features[i]) { + default: + if (typeof object.features[i] === "number") { + message.features[i] = object.features[i]; + break; + } + case "FEATURE_UNSPECIFIED": + case 0: + message.features[i] = 0; + break; + case "LABEL_DETECTION": + case 1: + message.features[i] = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.features[i] = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.features[i] = 3; + break; + case "TEXT_DETECTION": + case 7: + message.features[i] = 7; + break; + case "OBJECT_TRACKING": + case 9: + message.features[i] = 9; + break; + } + } + if (object.videoContext != null) { + if (typeof object.videoContext !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.videoContext: object expected"); + message.videoContext = $root.google.cloud.videointelligence.v1p2beta1.VideoContext.fromObject(object.videoContext); + } + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} message AnnotateVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputUri = ""; + object.videoContext = null; + object.outputUri = ""; + object.locationId = ""; + if (options.bytes === String) + object.inputContent = ""; + else { + object.inputContent = []; + if (options.bytes !== Array) + object.inputContent = $util.newBuffer(object.inputContent); + } + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = options.enums === String ? $root.google.cloud.videointelligence.v1p2beta1.Feature[message.features[j]] === undefined ? message.features[j] : $root.google.cloud.videointelligence.v1p2beta1.Feature[message.features[j]] : message.features[j]; + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) + object.videoContext = $root.google.cloud.videointelligence.v1p2beta1.VideoContext.toObject(message.videoContext, options); + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + object.inputContent = options.bytes === String ? $util.base64.encode(message.inputContent, 0, message.inputContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputContent) : message.inputContent; + return object; + }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest"; + }; + + return AnnotateVideoRequest; + })(); + + v1p2beta1.VideoContext = (function() { + + /** + * Properties of a VideoContext. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IVideoContext + * @property {Array.|null} [segments] VideoContext segments + * @property {google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig|null} [labelDetectionConfig] VideoContext labelDetectionConfig + * @property {google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig|null} [shotChangeDetectionConfig] VideoContext shotChangeDetectionConfig + * @property {google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig|null} [explicitContentDetectionConfig] VideoContext explicitContentDetectionConfig + * @property {google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig|null} [textDetectionConfig] VideoContext textDetectionConfig + */ + + /** + * Constructs a new VideoContext. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a VideoContext. + * @implements IVideoContext + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IVideoContext=} [properties] Properties to set + */ + function VideoContext(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoContext segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @instance + */ + VideoContext.prototype.segments = $util.emptyArray; + + /** + * VideoContext labelDetectionConfig. + * @member {google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig|null|undefined} labelDetectionConfig + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @instance + */ + VideoContext.prototype.labelDetectionConfig = null; + + /** + * VideoContext shotChangeDetectionConfig. + * @member {google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig|null|undefined} shotChangeDetectionConfig + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @instance + */ + VideoContext.prototype.shotChangeDetectionConfig = null; + + /** + * VideoContext explicitContentDetectionConfig. + * @member {google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig|null|undefined} explicitContentDetectionConfig + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @instance + */ + VideoContext.prototype.explicitContentDetectionConfig = null; + + /** + * VideoContext textDetectionConfig. + * @member {google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig|null|undefined} textDetectionConfig + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @instance + */ + VideoContext.prototype.textDetectionConfig = null; + + /** + * Creates a new VideoContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.VideoContext} VideoContext instance + */ + VideoContext.create = function create(properties) { + return new VideoContext(properties); + }; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labelDetectionConfig != null && Object.hasOwnProperty.call(message, "labelDetectionConfig")) + $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.encode(message.labelDetectionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotChangeDetectionConfig != null && Object.hasOwnProperty.call(message, "shotChangeDetectionConfig")) + $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.encode(message.shotChangeDetectionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explicitContentDetectionConfig != null && Object.hasOwnProperty.call(message, "explicitContentDetectionConfig")) + $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.encode(message.explicitContentDetectionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.textDetectionConfig != null && Object.hasOwnProperty.call(message, "textDetectionConfig")) + $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.encode(message.textDetectionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decode = function 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.videointelligence.v1p2beta1.VideoContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.textDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.verify(message.labelDetectionConfig); + if (error) + return "labelDetectionConfig." + error; + } + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.verify(message.shotChangeDetectionConfig); + if (error) + return "shotChangeDetectionConfig." + error; + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.verify(message.explicitContentDetectionConfig); + if (error) + return "explicitContentDetectionConfig." + error; + } + if (message.textDetectionConfig != null && message.hasOwnProperty("textDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.verify(message.textDetectionConfig); + if (error) + return "textDetectionConfig." + error; + } + return null; + }; + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.VideoContext} VideoContext + */ + VideoContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.VideoContext) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.VideoContext(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoContext.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoContext.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.segments[i]); + } + } + if (object.labelDetectionConfig != null) { + if (typeof object.labelDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoContext.labelDetectionConfig: object expected"); + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.fromObject(object.labelDetectionConfig); + } + if (object.shotChangeDetectionConfig != null) { + if (typeof object.shotChangeDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoContext.shotChangeDetectionConfig: object expected"); + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.fromObject(object.shotChangeDetectionConfig); + } + if (object.explicitContentDetectionConfig != null) { + if (typeof object.explicitContentDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoContext.explicitContentDetectionConfig: object expected"); + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.fromObject(object.explicitContentDetectionConfig); + } + if (object.textDetectionConfig != null) { + if (typeof object.textDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoContext.textDetectionConfig: object expected"); + message.textDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.fromObject(object.textDetectionConfig); + } + return message; + }; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p2beta1.VideoContext} message VideoContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) { + object.labelDetectionConfig = null; + object.shotChangeDetectionConfig = null; + object.explicitContentDetectionConfig = null; + object.textDetectionConfig = null; + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.toObject(message.segments[j], options); + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) + object.labelDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.toObject(message.labelDetectionConfig, options); + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) + object.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.toObject(message.shotChangeDetectionConfig, options); + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) + object.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.toObject(message.explicitContentDetectionConfig, options); + if (message.textDetectionConfig != null && message.hasOwnProperty("textDetectionConfig")) + object.textDetectionConfig = $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.toObject(message.textDetectionConfig, options); + return object; + }; + + /** + * Converts this VideoContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @instance + * @returns {Object.} JSON object + */ + VideoContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.VideoContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.VideoContext"; + }; + + return VideoContext; + })(); + + v1p2beta1.LabelDetectionConfig = (function() { + + /** + * Properties of a LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ILabelDetectionConfig + * @property {google.cloud.videointelligence.v1p2beta1.LabelDetectionMode|null} [labelDetectionMode] LabelDetectionConfig labelDetectionMode + * @property {boolean|null} [stationaryCamera] LabelDetectionConfig stationaryCamera + * @property {string|null} [model] LabelDetectionConfig model + */ + + /** + * Constructs a new LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a LabelDetectionConfig. + * @implements ILabelDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig=} [properties] Properties to set + */ + function LabelDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelDetectionConfig labelDetectionMode. + * @member {google.cloud.videointelligence.v1p2beta1.LabelDetectionMode} labelDetectionMode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.labelDetectionMode = 0; + + /** + * LabelDetectionConfig stationaryCamera. + * @member {boolean} stationaryCamera + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.stationaryCamera = false; + + /** + * LabelDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.model = ""; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} LabelDetectionConfig instance + */ + LabelDetectionConfig.create = function create(properties) { + return new LabelDetectionConfig(properties); + }; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelDetectionMode != null && Object.hasOwnProperty.call(message, "labelDetectionMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelDetectionMode); + if (message.stationaryCamera != null && Object.hasOwnProperty.call(message, "stationaryCamera")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.stationaryCamera); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decode = function 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.videointelligence.v1p2beta1.LabelDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelDetectionMode = reader.int32(); + break; + } + case 2: { + message.stationaryCamera = reader.bool(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + switch (message.labelDetectionMode) { + default: + return "labelDetectionMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + if (typeof message.stationaryCamera !== "boolean") + return "stationaryCamera: boolean expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} LabelDetectionConfig + */ + LabelDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig(); + switch (object.labelDetectionMode) { + default: + if (typeof object.labelDetectionMode === "number") { + message.labelDetectionMode = object.labelDetectionMode; + break; + } + break; + case "LABEL_DETECTION_MODE_UNSPECIFIED": + case 0: + message.labelDetectionMode = 0; + break; + case "SHOT_MODE": + case 1: + message.labelDetectionMode = 1; + break; + case "FRAME_MODE": + case 2: + message.labelDetectionMode = 2; + break; + case "SHOT_AND_FRAME_MODE": + case 3: + message.labelDetectionMode = 3; + break; + } + if (object.stationaryCamera != null) + message.stationaryCamera = Boolean(object.stationaryCamera); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} message LabelDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelDetectionMode = options.enums === String ? "LABEL_DETECTION_MODE_UNSPECIFIED" : 0; + object.stationaryCamera = false; + object.model = ""; + } + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + object.labelDetectionMode = options.enums === String ? $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode[message.labelDetectionMode] === undefined ? message.labelDetectionMode : $root.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode[message.labelDetectionMode] : message.labelDetectionMode; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + object.stationaryCamera = message.stationaryCamera; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + LabelDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig"; + }; + + return LabelDetectionConfig; + })(); + + v1p2beta1.ShotChangeDetectionConfig = (function() { + + /** + * Properties of a ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IShotChangeDetectionConfig + * @property {string|null} [model] ShotChangeDetectionConfig model + */ + + /** + * Constructs a new ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a ShotChangeDetectionConfig. + * @implements IShotChangeDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig=} [properties] Properties to set + */ + function ShotChangeDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShotChangeDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @instance + */ + ShotChangeDetectionConfig.prototype.model = ""; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig instance + */ + ShotChangeDetectionConfig.create = function create(properties) { + return new ShotChangeDetectionConfig(properties); + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decode = function 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShotChangeDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + */ + ShotChangeDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} message ShotChangeDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShotChangeDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ShotChangeDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShotChangeDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig"; + }; + + return ShotChangeDetectionConfig; + })(); + + v1p2beta1.ExplicitContentDetectionConfig = (function() { + + /** + * Properties of an ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IExplicitContentDetectionConfig + * @property {string|null} [model] ExplicitContentDetectionConfig model + */ + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an ExplicitContentDetectionConfig. + * @implements IExplicitContentDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig=} [properties] Properties to set + */ + function ExplicitContentDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @instance + */ + ExplicitContentDetectionConfig.prototype.model = ""; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig instance + */ + ExplicitContentDetectionConfig.create = function create(properties) { + return new ExplicitContentDetectionConfig(properties); + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decode = function 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + */ + ExplicitContentDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} message ExplicitContentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig"; + }; + + return ExplicitContentDetectionConfig; + })(); + + v1p2beta1.TextDetectionConfig = (function() { + + /** + * Properties of a TextDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ITextDetectionConfig + * @property {Array.|null} [languageHints] TextDetectionConfig languageHints + */ + + /** + * Constructs a new TextDetectionConfig. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a TextDetectionConfig. + * @implements ITextDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig=} [properties] Properties to set + */ + function TextDetectionConfig(properties) { + this.languageHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextDetectionConfig languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @instance + */ + TextDetectionConfig.prototype.languageHints = $util.emptyArray; + + /** + * Creates a new TextDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} TextDetectionConfig instance + */ + TextDetectionConfig.create = function create(properties) { + return new TextDetectionConfig(properties); + }; + + /** + * Encodes the specified TextDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig} message TextDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); + return writer; + }; + + /** + * Encodes the specified TextDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextDetectionConfig} message TextDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} TextDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextDetectionConfig.decode = function 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.videointelligence.v1p2beta1.TextDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} TextDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + return null; + }; + + /** + * Creates a TextDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} TextDetectionConfig + */ + TextDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig(); + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + return message; + }; + + /** + * Creates a plain object from a TextDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} message TextDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + return object; + }; + + /** + * Converts this TextDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + TextDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.TextDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.TextDetectionConfig"; + }; + + return TextDetectionConfig; + })(); + + v1p2beta1.VideoSegment = (function() { + + /** + * Properties of a VideoSegment. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IVideoSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] VideoSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] VideoSegment endTimeOffset + */ + + /** + * Constructs a new VideoSegment. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a VideoSegment. + * @implements IVideoSegment + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IVideoSegment=} [properties] Properties to set + */ + function VideoSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @instance + */ + VideoSegment.prototype.startTimeOffset = null; + + /** + * VideoSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @instance + */ + VideoSegment.prototype.endTimeOffset = null; + + /** + * Creates a new VideoSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.VideoSegment} VideoSegment instance + */ + VideoSegment.create = function create(properties) { + return new VideoSegment(properties); + }; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.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(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decode = function 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.videointelligence.v1p2beta1.VideoSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoSegment.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; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.VideoSegment} VideoSegment + */ + VideoSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.VideoSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.VideoSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoSegment.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.videointelligence.v1p2beta1.VideoSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.VideoSegment} message VideoSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeOffset = null; + object.endTimeOffset = null; + } + 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 VideoSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @instance + * @returns {Object.} JSON object + */ + VideoSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.VideoSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.VideoSegment"; + }; + + return VideoSegment; + })(); + + v1p2beta1.LabelSegment = (function() { + + /** + * Properties of a LabelSegment. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ILabelSegment + * @property {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null} [segment] LabelSegment segment + * @property {number|null} [confidence] LabelSegment confidence + */ + + /** + * Constructs a new LabelSegment. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a LabelSegment. + * @implements ILabelSegment + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ILabelSegment=} [properties] Properties to set + */ + function LabelSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelSegment segment. + * @member {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @instance + */ + LabelSegment.prototype.segment = null; + + /** + * LabelSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @instance + */ + LabelSegment.prototype.confidence = 0; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.LabelSegment} LabelSegment instance + */ + LabelSegment.create = function create(properties) { + return new LabelSegment(properties); + }; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decode = function 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.videointelligence.v1p2beta1.LabelSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.LabelSegment} LabelSegment + */ + LabelSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.LabelSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.LabelSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.LabelSegment} message LabelSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @instance + * @returns {Object.} JSON object + */ + LabelSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.LabelSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.LabelSegment"; + }; + + return LabelSegment; + })(); + + v1p2beta1.LabelFrame = (function() { + + /** + * Properties of a LabelFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ILabelFrame + * @property {google.protobuf.IDuration|null} [timeOffset] LabelFrame timeOffset + * @property {number|null} [confidence] LabelFrame confidence + */ + + /** + * Constructs a new LabelFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a LabelFrame. + * @implements ILabelFrame + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ILabelFrame=} [properties] Properties to set + */ + function LabelFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @instance + */ + LabelFrame.prototype.timeOffset = null; + + /** + * LabelFrame confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @instance + */ + LabelFrame.prototype.confidence = 0; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.LabelFrame} LabelFrame instance + */ + LabelFrame.create = function create(properties) { + return new LabelFrame(properties); + }; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decode = function 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.videointelligence.v1p2beta1.LabelFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.LabelFrame} LabelFrame + */ + LabelFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.LabelFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.LabelFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.LabelFrame} message LabelFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.confidence = 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @instance + * @returns {Object.} JSON object + */ + LabelFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.LabelFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.LabelFrame"; + }; + + return LabelFrame; + })(); + + v1p2beta1.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IEntity + * @property {string|null} [entityId] Entity entityId + * @property {string|null} [description] Entity description + * @property {string|null} [languageCode] Entity languageCode + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity entityId. + * @member {string} entityId + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @instance + */ + Entity.prototype.entityId = ""; + + /** + * Entity description. + * @member {string} description + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @instance + */ + Entity.prototype.description = ""; + + /** + * Entity languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @instance + */ + Entity.prototype.languageCode = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IEntity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function 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.videointelligence.v1p2beta1.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.Entity) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.Entity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p2beta1.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.description = ""; + object.languageCode = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.Entity"; + }; + + return Entity; + })(); + + v1p2beta1.LabelAnnotation = (function() { + + /** + * Properties of a LabelAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ILabelAnnotation + * @property {google.cloud.videointelligence.v1p2beta1.IEntity|null} [entity] LabelAnnotation entity + * @property {Array.|null} [categoryEntities] LabelAnnotation categoryEntities + * @property {Array.|null} [segments] LabelAnnotation segments + * @property {Array.|null} [frames] LabelAnnotation frames + */ + + /** + * Constructs a new LabelAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a LabelAnnotation. + * @implements ILabelAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ILabelAnnotation=} [properties] Properties to set + */ + function LabelAnnotation(properties) { + this.categoryEntities = []; + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelAnnotation entity. + * @member {google.cloud.videointelligence.v1p2beta1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.entity = null; + + /** + * LabelAnnotation categoryEntities. + * @member {Array.} categoryEntities + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.categoryEntities = $util.emptyArray; + + /** + * LabelAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.segments = $util.emptyArray; + + /** + * LabelAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.LabelAnnotation} LabelAnnotation instance + */ + LabelAnnotation.create = function create(properties) { + return new LabelAnnotation(properties); + }; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1p2beta1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.categoryEntities != null && message.categoryEntities.length) + for (var i = 0; i < message.categoryEntities.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.Entity.encode(message.categoryEntities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.LabelSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.LabelFrame.encode(message.frames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decode = function 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.videointelligence.v1p2beta1.LabelAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.categoryEntities && message.categoryEntities.length)) + message.categoryEntities = []; + message.categoryEntities.push($root.google.cloud.videointelligence.v1p2beta1.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p2beta1.LabelSegment.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p2beta1.LabelFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.categoryEntities != null && message.hasOwnProperty("categoryEntities")) { + if (!Array.isArray(message.categoryEntities)) + return "categoryEntities: array expected"; + for (var i = 0; i < message.categoryEntities.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.Entity.verify(message.categoryEntities[i]); + if (error) + return "categoryEntities." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.LabelSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.LabelFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.LabelAnnotation} LabelAnnotation + */ + LabelAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.fromObject(object.entity); + } + if (object.categoryEntities) { + if (!Array.isArray(object.categoryEntities)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.categoryEntities: array expected"); + message.categoryEntities = []; + for (var i = 0; i < object.categoryEntities.length; ++i) { + if (typeof object.categoryEntities[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.categoryEntities: object expected"); + message.categoryEntities[i] = $root.google.cloud.videointelligence.v1p2beta1.Entity.fromObject(object.categoryEntities[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p2beta1.LabelSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.LabelAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p2beta1.LabelFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.LabelAnnotation} message LabelAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categoryEntities = []; + object.segments = []; + object.frames = []; + } + if (options.defaults) + object.entity = null; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.toObject(message.entity, options); + if (message.categoryEntities && message.categoryEntities.length) { + object.categoryEntities = []; + for (var j = 0; j < message.categoryEntities.length; ++j) + object.categoryEntities[j] = $root.google.cloud.videointelligence.v1p2beta1.Entity.toObject(message.categoryEntities[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p2beta1.LabelSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p2beta1.LabelFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this LabelAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @instance + * @returns {Object.} JSON object + */ + LabelAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.LabelAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.LabelAnnotation"; + }; + + return LabelAnnotation; + })(); + + v1p2beta1.ExplicitContentFrame = (function() { + + /** + * Properties of an ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IExplicitContentFrame + * @property {google.protobuf.IDuration|null} [timeOffset] ExplicitContentFrame timeOffset + * @property {google.cloud.videointelligence.v1p2beta1.Likelihood|null} [pornographyLikelihood] ExplicitContentFrame pornographyLikelihood + */ + + /** + * Constructs a new ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an ExplicitContentFrame. + * @implements IExplicitContentFrame + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame=} [properties] Properties to set + */ + function ExplicitContentFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.timeOffset = null; + + /** + * ExplicitContentFrame pornographyLikelihood. + * @member {google.cloud.videointelligence.v1p2beta1.Likelihood} pornographyLikelihood + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.pornographyLikelihood = 0; + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} ExplicitContentFrame instance + */ + ExplicitContentFrame.create = function create(properties) { + return new ExplicitContentFrame(properties); + }; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pornographyLikelihood != null && Object.hasOwnProperty.call(message, "pornographyLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pornographyLikelihood); + return writer; + }; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decode = function 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.videointelligence.v1p2beta1.ExplicitContentFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pornographyLikelihood = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + switch (message.pornographyLikelihood) { + default: + return "pornographyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} ExplicitContentFrame + */ + ExplicitContentFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + switch (object.pornographyLikelihood) { + default: + if (typeof object.pornographyLikelihood === "number") { + message.pornographyLikelihood = object.pornographyLikelihood; + break; + } + break; + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.pornographyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.pornographyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.pornographyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.pornographyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.pornographyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.pornographyLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} message ExplicitContentFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.pornographyLikelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + object.pornographyLikelihood = options.enums === String ? $root.google.cloud.videointelligence.v1p2beta1.Likelihood[message.pornographyLikelihood] === undefined ? message.pornographyLikelihood : $root.google.cloud.videointelligence.v1p2beta1.Likelihood[message.pornographyLikelihood] : message.pornographyLikelihood; + return object; + }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame"; + }; + + return ExplicitContentFrame; + })(); + + v1p2beta1.ExplicitContentAnnotation = (function() { + + /** + * Properties of an ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IExplicitContentAnnotation + * @property {Array.|null} [frames] ExplicitContentAnnotation frames + */ + + /** + * Constructs a new ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an ExplicitContentAnnotation. + * @implements IExplicitContentAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation=} [properties] Properties to set + */ + function ExplicitContentAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @instance + */ + ExplicitContentAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} ExplicitContentAnnotation instance + */ + ExplicitContentAnnotation.create = function create(properties) { + return new ExplicitContentAnnotation(properties); + }; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.encode(message.frames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decode = function 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.videointelligence.v1p2beta1.ExplicitContentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates an ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + */ + ExplicitContentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation(); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} message ExplicitContentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation"; + }; + + return ExplicitContentAnnotation; + })(); + + v1p2beta1.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface INormalizedBoundingBox + * @property {number|null} [left] NormalizedBoundingBox left + * @property {number|null} [top] NormalizedBoundingBox top + * @property {number|null} [right] NormalizedBoundingBox right + * @property {number|null} [bottom] NormalizedBoundingBox bottom + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox left. + * @member {number} left + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.left = 0; + + /** + * NormalizedBoundingBox top. + * @member {number} top + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.top = 0; + + /** + * NormalizedBoundingBox right. + * @member {number} right + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.right = 0; + + /** + * NormalizedBoundingBox bottom. + * @member {number} bottom + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.bottom = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.left); + if (message.top != null && Object.hasOwnProperty.call(message, "top")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.top); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.right); + if (message.bottom != null && Object.hasOwnProperty.call(message, "bottom")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.bottom); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function 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.videointelligence.v1p2beta1.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.left = reader.float(); + break; + } + case 2: { + message.top = reader.float(); + break; + } + case 3: { + message.right = reader.float(); + break; + } + case 4: { + message.bottom = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.left != null && message.hasOwnProperty("left")) + if (typeof message.left !== "number") + return "left: number expected"; + if (message.top != null && message.hasOwnProperty("top")) + if (typeof message.top !== "number") + return "top: number expected"; + if (message.right != null && message.hasOwnProperty("right")) + if (typeof message.right !== "number") + return "right: number expected"; + if (message.bottom != null && message.hasOwnProperty("bottom")) + if (typeof message.bottom !== "number") + return "bottom: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox(); + if (object.left != null) + message.left = Number(object.left); + if (object.top != null) + message.top = Number(object.top); + if (object.right != null) + message.right = Number(object.right); + if (object.bottom != null) + message.bottom = Number(object.bottom); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.left = 0; + object.top = 0; + object.right = 0; + object.bottom = 0; + } + if (message.left != null && message.hasOwnProperty("left")) + object.left = options.json && !isFinite(message.left) ? String(message.left) : message.left; + if (message.top != null && message.hasOwnProperty("top")) + object.top = options.json && !isFinite(message.top) ? String(message.top) : message.top; + if (message.right != null && message.hasOwnProperty("right")) + object.right = options.json && !isFinite(message.right) ? String(message.right) : message.right; + if (message.bottom != null && message.hasOwnProperty("bottom")) + object.bottom = options.json && !isFinite(message.bottom) ? String(message.bottom) : message.bottom; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + v1p2beta1.VideoAnnotationResults = (function() { + + /** + * Properties of a VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IVideoAnnotationResults + * @property {string|null} [inputUri] VideoAnnotationResults inputUri + * @property {Array.|null} [segmentLabelAnnotations] VideoAnnotationResults segmentLabelAnnotations + * @property {Array.|null} [shotLabelAnnotations] VideoAnnotationResults shotLabelAnnotations + * @property {Array.|null} [frameLabelAnnotations] VideoAnnotationResults frameLabelAnnotations + * @property {Array.|null} [shotAnnotations] VideoAnnotationResults shotAnnotations + * @property {google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation|null} [explicitAnnotation] VideoAnnotationResults explicitAnnotation + * @property {Array.|null} [textAnnotations] VideoAnnotationResults textAnnotations + * @property {Array.|null} [objectAnnotations] VideoAnnotationResults objectAnnotations + * @property {google.rpc.IStatus|null} [error] VideoAnnotationResults error + */ + + /** + * Constructs a new VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a VideoAnnotationResults. + * @implements IVideoAnnotationResults + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults=} [properties] Properties to set + */ + function VideoAnnotationResults(properties) { + this.segmentLabelAnnotations = []; + this.shotLabelAnnotations = []; + this.frameLabelAnnotations = []; + this.shotAnnotations = []; + this.textAnnotations = []; + this.objectAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationResults inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.inputUri = ""; + + /** + * VideoAnnotationResults segmentLabelAnnotations. + * @member {Array.} segmentLabelAnnotations + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotLabelAnnotations. + * @member {Array.} shotLabelAnnotations + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults frameLabelAnnotations. + * @member {Array.} frameLabelAnnotations + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.frameLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotAnnotations. + * @member {Array.} shotAnnotations + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults explicitAnnotation. + * @member {google.cloud.videointelligence.v1p2beta1.IExplicitContentAnnotation|null|undefined} explicitAnnotation + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.explicitAnnotation = null; + + /** + * VideoAnnotationResults textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.textAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults objectAnnotations. + * @member {Array.} objectAnnotations + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.objectAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.error = null; + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} VideoAnnotationResults instance + */ + VideoAnnotationResults.create = function create(properties) { + return new VideoAnnotationResults(properties); + }; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.segmentLabelAnnotations != null && message.segmentLabelAnnotations.length) + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.encode(message.segmentLabelAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotLabelAnnotations != null && message.shotLabelAnnotations.length) + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.encode(message.shotLabelAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frameLabelAnnotations != null && message.frameLabelAnnotations.length) + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.encode(message.frameLabelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.shotAnnotations != null && message.shotAnnotations.length) + for (var i = 0; i < message.shotAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.encode(message.shotAnnotations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.explicitAnnotation != null && Object.hasOwnProperty.call(message, "explicitAnnotation")) + $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.encode(message.explicitAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.TextAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.objectAnnotations != null && message.objectAnnotations.length) + for (var i = 0; i < message.objectAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.encode(message.objectAnnotations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decode = function 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.videointelligence.v1p2beta1.VideoAnnotationResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + if (!(message.segmentLabelAnnotations && message.segmentLabelAnnotations.length)) + message.segmentLabelAnnotations = []; + message.segmentLabelAnnotations.push($root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.shotLabelAnnotations && message.shotLabelAnnotations.length)) + message.shotLabelAnnotations = []; + message.shotLabelAnnotations.push($root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frameLabelAnnotations && message.frameLabelAnnotations.length)) + message.frameLabelAnnotations = []; + message.frameLabelAnnotations.push($root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.shotAnnotations && message.shotAnnotations.length)) + message.shotAnnotations = []; + message.shotAnnotations.push($root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.videointelligence.v1p2beta1.TextAnnotation.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.objectAnnotations && message.objectAnnotations.length)) + message.objectAnnotations = []; + message.objectAnnotations.push($root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.decode(reader, reader.uint32())); + break; + } + case 9: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationResults message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.segmentLabelAnnotations != null && message.hasOwnProperty("segmentLabelAnnotations")) { + if (!Array.isArray(message.segmentLabelAnnotations)) + return "segmentLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify(message.segmentLabelAnnotations[i]); + if (error) + return "segmentLabelAnnotations." + error; + } + } + if (message.shotLabelAnnotations != null && message.hasOwnProperty("shotLabelAnnotations")) { + if (!Array.isArray(message.shotLabelAnnotations)) + return "shotLabelAnnotations: array expected"; + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify(message.shotLabelAnnotations[i]); + if (error) + return "shotLabelAnnotations." + error; + } + } + if (message.frameLabelAnnotations != null && message.hasOwnProperty("frameLabelAnnotations")) { + if (!Array.isArray(message.frameLabelAnnotations)) + return "frameLabelAnnotations: array expected"; + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.verify(message.frameLabelAnnotations[i]); + if (error) + return "frameLabelAnnotations." + error; + } + } + if (message.shotAnnotations != null && message.hasOwnProperty("shotAnnotations")) { + if (!Array.isArray(message.shotAnnotations)) + return "shotAnnotations: array expected"; + for (var i = 0; i < message.shotAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.shotAnnotations[i]); + if (error) + return "shotAnnotations." + error; + } + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.verify(message.explicitAnnotation); + if (error) + return "explicitAnnotation." + error; + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.TextAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.objectAnnotations != null && message.hasOwnProperty("objectAnnotations")) { + if (!Array.isArray(message.objectAnnotations)) + return "objectAnnotations: array expected"; + for (var i = 0; i < message.objectAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.verify(message.objectAnnotations[i]); + if (error) + return "objectAnnotations." + error; + } + } + 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 VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} VideoAnnotationResults + */ + VideoAnnotationResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.segmentLabelAnnotations) { + if (!Array.isArray(object.segmentLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.segmentLabelAnnotations: array expected"); + message.segmentLabelAnnotations = []; + for (var i = 0; i < object.segmentLabelAnnotations.length; ++i) { + if (typeof object.segmentLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.segmentLabelAnnotations: object expected"); + message.segmentLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.fromObject(object.segmentLabelAnnotations[i]); + } + } + if (object.shotLabelAnnotations) { + if (!Array.isArray(object.shotLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.shotLabelAnnotations: array expected"); + message.shotLabelAnnotations = []; + for (var i = 0; i < object.shotLabelAnnotations.length; ++i) { + if (typeof object.shotLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.shotLabelAnnotations: object expected"); + message.shotLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.fromObject(object.shotLabelAnnotations[i]); + } + } + if (object.frameLabelAnnotations) { + if (!Array.isArray(object.frameLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.frameLabelAnnotations: array expected"); + message.frameLabelAnnotations = []; + for (var i = 0; i < object.frameLabelAnnotations.length; ++i) { + if (typeof object.frameLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.frameLabelAnnotations: object expected"); + message.frameLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.fromObject(object.frameLabelAnnotations[i]); + } + } + if (object.shotAnnotations) { + if (!Array.isArray(object.shotAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.shotAnnotations: array expected"); + message.shotAnnotations = []; + for (var i = 0; i < object.shotAnnotations.length; ++i) { + if (typeof object.shotAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.shotAnnotations: object expected"); + message.shotAnnotations[i] = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.shotAnnotations[i]); + } + } + if (object.explicitAnnotation != null) { + if (typeof object.explicitAnnotation !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.explicitAnnotation: object expected"); + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.fromObject(object.explicitAnnotation); + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.videointelligence.v1p2beta1.TextAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.objectAnnotations) { + if (!Array.isArray(object.objectAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.objectAnnotations: array expected"); + message.objectAnnotations = []; + for (var i = 0; i < object.objectAnnotations.length; ++i) { + if (typeof object.objectAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.objectAnnotations: object expected"); + message.objectAnnotations[i] = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.fromObject(object.objectAnnotations[i]); + } + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} message VideoAnnotationResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segmentLabelAnnotations = []; + object.shotLabelAnnotations = []; + object.frameLabelAnnotations = []; + object.shotAnnotations = []; + object.textAnnotations = []; + object.objectAnnotations = []; + } + if (options.defaults) { + object.inputUri = ""; + object.explicitAnnotation = null; + object.error = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.segmentLabelAnnotations && message.segmentLabelAnnotations.length) { + object.segmentLabelAnnotations = []; + for (var j = 0; j < message.segmentLabelAnnotations.length; ++j) + object.segmentLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.toObject(message.segmentLabelAnnotations[j], options); + } + if (message.shotLabelAnnotations && message.shotLabelAnnotations.length) { + object.shotLabelAnnotations = []; + for (var j = 0; j < message.shotLabelAnnotations.length; ++j) + object.shotLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.toObject(message.shotLabelAnnotations[j], options); + } + if (message.frameLabelAnnotations && message.frameLabelAnnotations.length) { + object.frameLabelAnnotations = []; + for (var j = 0; j < message.frameLabelAnnotations.length; ++j) + object.frameLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.toObject(message.frameLabelAnnotations[j], options); + } + if (message.shotAnnotations && message.shotAnnotations.length) { + object.shotAnnotations = []; + for (var j = 0; j < message.shotAnnotations.length; ++j) + object.shotAnnotations[j] = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.toObject(message.shotAnnotations[j], options); + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) + object.explicitAnnotation = $root.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.toObject(message.explicitAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.videointelligence.v1p2beta1.TextAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.objectAnnotations && message.objectAnnotations.length) { + object.objectAnnotations = []; + for (var j = 0; j < message.objectAnnotations.length; ++j) + object.objectAnnotations[j] = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.toObject(message.objectAnnotations[j], options); + } + return object; + }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationResults + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults"; + }; + + return VideoAnnotationResults; + })(); + + v1p2beta1.AnnotateVideoResponse = (function() { + + /** + * Properties of an AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IAnnotateVideoResponse + * @property {Array.|null} [annotationResults] AnnotateVideoResponse annotationResults + */ + + /** + * Constructs a new AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an AnnotateVideoResponse. + * @implements IAnnotateVideoResponse + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse=} [properties] Properties to set + */ + function AnnotateVideoResponse(properties) { + this.annotationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoResponse annotationResults. + * @member {Array.} annotationResults + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @instance + */ + AnnotateVideoResponse.prototype.annotationResults = $util.emptyArray; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} AnnotateVideoResponse instance + */ + AnnotateVideoResponse.create = function create(properties) { + return new AnnotateVideoResponse(properties); + }; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationResults != null && message.annotationResults.length) + for (var i = 0; i < message.annotationResults.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.encode(message.annotationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decode = function 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.videointelligence.v1p2beta1.AnnotateVideoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationResults && message.annotationResults.length)) + message.annotationResults = []; + message.annotationResults.push($root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoResponse message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) { + if (!Array.isArray(message.annotationResults)) + return "annotationResults: array expected"; + for (var i = 0; i < message.annotationResults.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.verify(message.annotationResults[i]); + if (error) + return "annotationResults." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} AnnotateVideoResponse + */ + AnnotateVideoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse(); + if (object.annotationResults) { + if (!Array.isArray(object.annotationResults)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.annotationResults: array expected"); + message.annotationResults = []; + for (var i = 0; i < object.annotationResults.length; ++i) { + if (typeof object.annotationResults[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.annotationResults: object expected"); + message.annotationResults[i] = $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.fromObject(object.annotationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} message AnnotateVideoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationResults = []; + if (message.annotationResults && message.annotationResults.length) { + object.annotationResults = []; + for (var j = 0; j < message.annotationResults.length; ++j) + object.annotationResults[j] = $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.toObject(message.annotationResults[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse"; + }; + + return AnnotateVideoResponse; + })(); + + v1p2beta1.VideoAnnotationProgress = (function() { + + /** + * Properties of a VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IVideoAnnotationProgress + * @property {string|null} [inputUri] VideoAnnotationProgress inputUri + * @property {number|null} [progressPercent] VideoAnnotationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] VideoAnnotationProgress startTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VideoAnnotationProgress updateTime + */ + + /** + * Constructs a new VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a VideoAnnotationProgress. + * @implements IVideoAnnotationProgress + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress=} [properties] Properties to set + */ + function VideoAnnotationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationProgress inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.inputUri = ""; + + /** + * VideoAnnotationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.progressPercent = 0; + + /** + * VideoAnnotationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.startTime = null; + + /** + * VideoAnnotationProgress updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.updateTime = null; + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} VideoAnnotationProgress instance + */ + VideoAnnotationProgress.create = function create(properties) { + return new VideoAnnotationProgress(properties); + }; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decode = function 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.videointelligence.v1p2beta1.VideoAnnotationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.progressPercent = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} VideoAnnotationProgress + */ + VideoAnnotationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} message VideoAnnotationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.progressPercent = 0; + object.startTime = null; + object.updateTime = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress"; + }; + + return VideoAnnotationProgress; + })(); + + v1p2beta1.AnnotateVideoProgress = (function() { + + /** + * Properties of an AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IAnnotateVideoProgress + * @property {Array.|null} [annotationProgress] AnnotateVideoProgress annotationProgress + */ + + /** + * Constructs a new AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an AnnotateVideoProgress. + * @implements IAnnotateVideoProgress + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress=} [properties] Properties to set + */ + function AnnotateVideoProgress(properties) { + this.annotationProgress = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoProgress annotationProgress. + * @member {Array.} annotationProgress + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @instance + */ + AnnotateVideoProgress.prototype.annotationProgress = $util.emptyArray; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} AnnotateVideoProgress instance + */ + AnnotateVideoProgress.create = function create(properties) { + return new AnnotateVideoProgress(properties); + }; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationProgress != null && message.annotationProgress.length) + for (var i = 0; i < message.annotationProgress.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.encode(message.annotationProgress[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decode = function 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.videointelligence.v1p2beta1.AnnotateVideoProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationProgress && message.annotationProgress.length)) + message.annotationProgress = []; + message.annotationProgress.push($root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationProgress != null && message.hasOwnProperty("annotationProgress")) { + if (!Array.isArray(message.annotationProgress)) + return "annotationProgress: array expected"; + for (var i = 0; i < message.annotationProgress.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.verify(message.annotationProgress[i]); + if (error) + return "annotationProgress." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} AnnotateVideoProgress + */ + AnnotateVideoProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress(); + if (object.annotationProgress) { + if (!Array.isArray(object.annotationProgress)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.annotationProgress: array expected"); + message.annotationProgress = []; + for (var i = 0; i < object.annotationProgress.length; ++i) { + if (typeof object.annotationProgress[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.annotationProgress: object expected"); + message.annotationProgress[i] = $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.fromObject(object.annotationProgress[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} message AnnotateVideoProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationProgress = []; + if (message.annotationProgress && message.annotationProgress.length) { + object.annotationProgress = []; + for (var j = 0; j < message.annotationProgress.length; ++j) + object.annotationProgress[j] = $root.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.toObject(message.annotationProgress[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress"; + }; + + return AnnotateVideoProgress; + })(); + + v1p2beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function 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.videointelligence.v1p2beta1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.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 NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex(); + 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 NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p2beta1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.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 NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1p2beta1.NormalizedBoundingPoly = (function() { + + /** + * Properties of a NormalizedBoundingPoly. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface INormalizedBoundingPoly + * @property {Array.|null} [vertices] NormalizedBoundingPoly vertices + */ + + /** + * Constructs a new NormalizedBoundingPoly. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a NormalizedBoundingPoly. + * @implements INormalizedBoundingPoly + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly=} [properties] Properties to set + */ + function NormalizedBoundingPoly(properties) { + this.vertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingPoly vertices. + * @member {Array.} vertices + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @instance + */ + NormalizedBoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} NormalizedBoundingPoly instance + */ + NormalizedBoundingPoly.create = function create(properties) { + return new NormalizedBoundingPoly(properties); + }; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decode = function 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.videointelligence.v1p2beta1.NormalizedBoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingPoly message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + */ + NormalizedBoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} message NormalizedBoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vertices = []; + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingPoly + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly"; + }; + + return NormalizedBoundingPoly; + })(); + + v1p2beta1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ITextSegment + * @property {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null} [segment] TextSegment segment + * @property {number|null} [confidence] TextSegment confidence + * @property {Array.|null} [frames] TextSegment frames + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment segment. + * @member {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @instance + */ + TextSegment.prototype.segment = null; + + /** + * TextSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @instance + */ + TextSegment.prototype.confidence = 0; + + /** + * TextSegment frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @instance + */ + TextSegment.prototype.frames = $util.emptyArray; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.TextFrame.encode(message.frames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function 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.videointelligence.v1p2beta1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p2beta1.TextFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.TextFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.TextSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.TextSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextSegment.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextSegment.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p2beta1.TextFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p2beta1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p2beta1.TextFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.TextSegment"; + }; + + return TextSegment; + })(); + + v1p2beta1.TextFrame = (function() { + + /** + * Properties of a TextFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ITextFrame + * @property {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly|null} [rotatedBoundingBox] TextFrame rotatedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] TextFrame timeOffset + */ + + /** + * Constructs a new TextFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a TextFrame. + * @implements ITextFrame + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ITextFrame=} [properties] Properties to set + */ + function TextFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextFrame rotatedBoundingBox. + * @member {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingPoly|null|undefined} rotatedBoundingBox + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @instance + */ + TextFrame.prototype.rotatedBoundingBox = null; + + /** + * TextFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @instance + */ + TextFrame.prototype.timeOffset = null; + + /** + * Creates a new TextFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.TextFrame} TextFrame instance + */ + TextFrame.create = function create(properties) { + return new TextFrame(properties); + }; + + /** + * Encodes the specified TextFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextFrame} message TextFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rotatedBoundingBox != null && Object.hasOwnProperty.call(message, "rotatedBoundingBox")) + $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.encode(message.rotatedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextFrame} message TextFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.TextFrame} TextFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFrame.decode = function 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.videointelligence.v1p2beta1.TextFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rotatedBoundingBox = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.TextFrame} TextFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rotatedBoundingBox != null && message.hasOwnProperty("rotatedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.verify(message.rotatedBoundingBox); + if (error) + return "rotatedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates a TextFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.TextFrame} TextFrame + */ + TextFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.TextFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.TextFrame(); + if (object.rotatedBoundingBox != null) { + if (typeof object.rotatedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextFrame.rotatedBoundingBox: object expected"); + message.rotatedBoundingBox = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.fromObject(object.rotatedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from a TextFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.TextFrame} message TextFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rotatedBoundingBox = null; + object.timeOffset = null; + } + if (message.rotatedBoundingBox != null && message.hasOwnProperty("rotatedBoundingBox")) + object.rotatedBoundingBox = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.toObject(message.rotatedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this TextFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @instance + * @returns {Object.} JSON object + */ + TextFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.TextFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.TextFrame"; + }; + + return TextFrame; + })(); + + v1p2beta1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface ITextAnnotation + * @property {string|null} [text] TextAnnotation text + * @property {Array.|null} [segments] TextAnnotation segments + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * TextAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.segments = $util.emptyArray; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.TextSegment.encode(message.segments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decode = function 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.videointelligence.v1p2beta1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p2beta1.TextSegment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.TextSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.TextAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.TextAnnotation(); + if (object.text != null) + message.text = String(object.text); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.TextAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p2beta1.TextSegment.fromObject(object.segments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p2beta1.TextSegment.toObject(message.segments[j], options); + } + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.TextAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.TextAnnotation"; + }; + + return TextAnnotation; + })(); + + v1p2beta1.ObjectTrackingFrame = (function() { + + /** + * Properties of an ObjectTrackingFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IObjectTrackingFrame + * @property {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox|null} [normalizedBoundingBox] ObjectTrackingFrame normalizedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] ObjectTrackingFrame timeOffset + */ + + /** + * Constructs a new ObjectTrackingFrame. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an ObjectTrackingFrame. + * @implements IObjectTrackingFrame + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame=} [properties] Properties to set + */ + function ObjectTrackingFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingFrame normalizedBoundingBox. + * @member {google.cloud.videointelligence.v1p2beta1.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.normalizedBoundingBox = null; + + /** + * ObjectTrackingFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.timeOffset = null; + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} ObjectTrackingFrame instance + */ + ObjectTrackingFrame.create = function create(properties) { + return new ObjectTrackingFrame(properties); + }; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame} message ObjectTrackingFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingFrame} message ObjectTrackingFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} ObjectTrackingFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingFrame.decode = function 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.videointelligence.v1p2beta1.ObjectTrackingFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} ObjectTrackingFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.verify(message.normalizedBoundingBox); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates an ObjectTrackingFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} ObjectTrackingFrame + */ + ObjectTrackingFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} message ObjectTrackingFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.normalizedBoundingBox = null; + object.timeOffset = null; + } + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this ObjectTrackingFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame"; + }; + + return ObjectTrackingFrame; + })(); + + v1p2beta1.ObjectTrackingAnnotation = (function() { + + /** + * Properties of an ObjectTrackingAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @interface IObjectTrackingAnnotation + * @property {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null} [segment] ObjectTrackingAnnotation segment + * @property {number|Long|null} [trackId] ObjectTrackingAnnotation trackId + * @property {google.cloud.videointelligence.v1p2beta1.IEntity|null} [entity] ObjectTrackingAnnotation entity + * @property {number|null} [confidence] ObjectTrackingAnnotation confidence + * @property {Array.|null} [frames] ObjectTrackingAnnotation frames + */ + + /** + * Constructs a new ObjectTrackingAnnotation. + * @memberof google.cloud.videointelligence.v1p2beta1 + * @classdesc Represents an ObjectTrackingAnnotation. + * @implements IObjectTrackingAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation=} [properties] Properties to set + */ + function ObjectTrackingAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingAnnotation segment. + * @member {google.cloud.videointelligence.v1p2beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.segment = null; + + /** + * ObjectTrackingAnnotation trackId. + * @member {number|Long|null|undefined} trackId + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.trackId = null; + + /** + * ObjectTrackingAnnotation entity. + * @member {google.cloud.videointelligence.v1p2beta1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.entity = null; + + /** + * ObjectTrackingAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.confidence = 0; + + /** + * ObjectTrackingAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.frames = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ObjectTrackingAnnotation trackInfo. + * @member {"segment"|"trackId"|undefined} trackInfo + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + */ + Object.defineProperty(ObjectTrackingAnnotation.prototype, "trackInfo", { + get: $util.oneOfGetter($oneOfFields = ["segment", "trackId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObjectTrackingAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation instance + */ + ObjectTrackingAnnotation.create = function create(properties) { + return new ObjectTrackingAnnotation(properties); + }; + + /** + * Encodes the specified ObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation} message ObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1p2beta1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.encode(message.frames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.trackId); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.IObjectTrackingAnnotation} message ObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingAnnotation.decode = function 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 5: { + message.trackId = reader.int64(); + break; + } + case 1: { + message.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.decode(reader, reader.uint32()); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 2: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.segment != null && message.hasOwnProperty("segment")) { + properties.trackInfo = 1; + { + var error = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + } + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (properties.trackInfo === 1) + return "trackInfo: multiple values"; + properties.trackInfo = 1; + if (!$util.isInteger(message.trackId) && !(message.trackId && $util.isInteger(message.trackId.low) && $util.isInteger(message.trackId.high))) + return "trackId: integer|Long expected"; + } + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1p2beta1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates an ObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + */ + ObjectTrackingAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.fromObject(object.segment); + } + if (object.trackId != null) + if ($util.Long) + (message.trackId = $util.Long.fromValue(object.trackId)).unsigned = false; + else if (typeof object.trackId === "string") + message.trackId = parseInt(object.trackId, 10); + else if (typeof object.trackId === "number") + message.trackId = object.trackId; + else if (typeof object.trackId === "object") + message.trackId = new $util.LongBits(object.trackId.low >>> 0, object.trackId.high >>> 0).toNumber(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.fromObject(object.entity); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} message ObjectTrackingAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) { + object.entity = null; + object.confidence = 0; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1p2beta1.Entity.toObject(message.entity, options); + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.toObject(message.frames[j], options); + } + if (message.segment != null && message.hasOwnProperty("segment")) { + object.segment = $root.google.cloud.videointelligence.v1p2beta1.VideoSegment.toObject(message.segment, options); + if (options.oneofs) + object.trackInfo = "segment"; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (typeof message.trackId === "number") + object.trackId = options.longs === String ? String(message.trackId) : message.trackId; + else + object.trackId = options.longs === String ? $util.Long.prototype.toString.call(message.trackId) : options.longs === Number ? new $util.LongBits(message.trackId.low >>> 0, message.trackId.high >>> 0).toNumber() : message.trackId; + if (options.oneofs) + object.trackInfo = "trackId"; + } + return object; + }; + + /** + * Converts this ObjectTrackingAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation"; + }; + + return ObjectTrackingAnnotation; + })(); + + /** + * Feature enum. + * @name google.cloud.videointelligence.v1p2beta1.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} LABEL_DETECTION=1 LABEL_DETECTION value + * @property {number} SHOT_CHANGE_DETECTION=2 SHOT_CHANGE_DETECTION value + * @property {number} EXPLICIT_CONTENT_DETECTION=3 EXPLICIT_CONTENT_DETECTION value + * @property {number} TEXT_DETECTION=7 TEXT_DETECTION value + * @property {number} OBJECT_TRACKING=9 OBJECT_TRACKING value + */ + v1p2beta1.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LABEL_DETECTION"] = 1; + values[valuesById[2] = "SHOT_CHANGE_DETECTION"] = 2; + values[valuesById[3] = "EXPLICIT_CONTENT_DETECTION"] = 3; + values[valuesById[7] = "TEXT_DETECTION"] = 7; + values[valuesById[9] = "OBJECT_TRACKING"] = 9; + return values; + })(); + + /** + * LabelDetectionMode enum. + * @name google.cloud.videointelligence.v1p2beta1.LabelDetectionMode + * @enum {number} + * @property {number} LABEL_DETECTION_MODE_UNSPECIFIED=0 LABEL_DETECTION_MODE_UNSPECIFIED value + * @property {number} SHOT_MODE=1 SHOT_MODE value + * @property {number} FRAME_MODE=2 FRAME_MODE value + * @property {number} SHOT_AND_FRAME_MODE=3 SHOT_AND_FRAME_MODE value + */ + v1p2beta1.LabelDetectionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LABEL_DETECTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOT_MODE"] = 1; + values[valuesById[2] = "FRAME_MODE"] = 2; + values[valuesById[3] = "SHOT_AND_FRAME_MODE"] = 3; + return values; + })(); + + /** + * Likelihood enum. + * @name google.cloud.videointelligence.v1p2beta1.Likelihood + * @enum {number} + * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p2beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + return v1p2beta1; + })(); + + videointelligence.v1p3beta1 = (function() { + + /** + * Namespace v1p3beta1. + * @memberof google.cloud.videointelligence + * @namespace + */ + var v1p3beta1 = {}; + + v1p3beta1.VideoIntelligenceService = (function() { + + /** + * Constructs a new VideoIntelligenceService service. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a VideoIntelligenceService + * @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 VideoIntelligenceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VideoIntelligenceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VideoIntelligenceService; + + /** + * Creates new VideoIntelligenceService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService + * @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 {VideoIntelligenceService} RPC service. Useful where requests and/or responses are streamed. + */ + VideoIntelligenceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService|annotateVideo}. + * @memberof google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService + * @typedef AnnotateVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @param {google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService.AnnotateVideoCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VideoIntelligenceService.prototype.annotateVideo = function annotateVideo(request, callback) { + return this.rpcCall(annotateVideo, $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnnotateVideo" }); + + /** + * Calls AnnotateVideo. + * @function annotateVideo + * @memberof google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest} request AnnotateVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VideoIntelligenceService; + })(); + + v1p3beta1.StreamingVideoIntelligenceService = (function() { + + /** + * Constructs a new StreamingVideoIntelligenceService service. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingVideoIntelligenceService + * @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 StreamingVideoIntelligenceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (StreamingVideoIntelligenceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = StreamingVideoIntelligenceService; + + /** + * Creates new StreamingVideoIntelligenceService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService + * @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 {StreamingVideoIntelligenceService} RPC service. Useful where requests and/or responses are streamed. + */ + StreamingVideoIntelligenceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService|streamingAnnotateVideo}. + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService + * @typedef StreamingAnnotateVideoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} [response] StreamingAnnotateVideoResponse + */ + + /** + * Calls StreamingAnnotateVideo. + * @function streamingAnnotateVideo + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest} request StreamingAnnotateVideoRequest message or plain object + * @param {google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService.StreamingAnnotateVideoCallback} callback Node-style callback called with the error, if any, and StreamingAnnotateVideoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(StreamingVideoIntelligenceService.prototype.streamingAnnotateVideo = function streamingAnnotateVideo(request, callback) { + return this.rpcCall(streamingAnnotateVideo, $root.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest, $root.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse, request, callback); + }, "name", { value: "StreamingAnnotateVideo" }); + + /** + * Calls StreamingAnnotateVideo. + * @function streamingAnnotateVideo + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService + * @instance + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest} request StreamingAnnotateVideoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return StreamingVideoIntelligenceService; + })(); + + v1p3beta1.AnnotateVideoRequest = (function() { + + /** + * Properties of an AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IAnnotateVideoRequest + * @property {string|null} [inputUri] AnnotateVideoRequest inputUri + * @property {Uint8Array|null} [inputContent] AnnotateVideoRequest inputContent + * @property {Array.|null} [features] AnnotateVideoRequest features + * @property {google.cloud.videointelligence.v1p3beta1.IVideoContext|null} [videoContext] AnnotateVideoRequest videoContext + * @property {string|null} [outputUri] AnnotateVideoRequest outputUri + * @property {string|null} [locationId] AnnotateVideoRequest locationId + */ + + /** + * Constructs a new AnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an AnnotateVideoRequest. + * @implements IAnnotateVideoRequest + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest=} [properties] Properties to set + */ + function AnnotateVideoRequest(properties) { + this.features = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoRequest inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputUri = ""; + + /** + * AnnotateVideoRequest inputContent. + * @member {Uint8Array} inputContent + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.inputContent = $util.newBuffer([]); + + /** + * AnnotateVideoRequest features. + * @member {Array.} features + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.features = $util.emptyArray; + + /** + * AnnotateVideoRequest videoContext. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoContext|null|undefined} videoContext + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.videoContext = null; + + /** + * AnnotateVideoRequest outputUri. + * @member {string} outputUri + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.outputUri = ""; + + /** + * AnnotateVideoRequest locationId. + * @member {string} locationId + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + */ + AnnotateVideoRequest.prototype.locationId = ""; + + /** + * Creates a new AnnotateVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest} AnnotateVideoRequest instance + */ + AnnotateVideoRequest.create = function create(properties) { + return new AnnotateVideoRequest(properties); + }; + + /** + * Encodes the specified AnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.features != null && message.features.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.features.length; ++i) + writer.int32(message.features[i]); + writer.ldelim(); + } + if (message.videoContext != null && Object.hasOwnProperty.call(message, "videoContext")) + $root.google.cloud.videointelligence.v1p3beta1.VideoContext.encode(message.videoContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUri); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.locationId); + if (message.inputContent != null && Object.hasOwnProperty.call(message, "inputContent")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputContent); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest} message AnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decode = function 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.videointelligence.v1p3beta1.AnnotateVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 6: { + message.inputContent = reader.bytes(); + break; + } + case 2: { + if (!(message.features && message.features.length)) + message.features = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.features.push(reader.int32()); + } else + message.features.push(reader.int32()); + break; + } + case 3: { + message.videoContext = $root.google.cloud.videointelligence.v1p3beta1.VideoContext.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputUri = reader.string(); + break; + } + case 5: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest} AnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoRequest message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + if (!(message.inputContent && typeof message.inputContent.length === "number" || $util.isString(message.inputContent))) + return "inputContent: buffer expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + switch (message.features[i]) { + default: + return "features: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 9: + case 12: + case 13: + case 14: + break; + } + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoContext.verify(message.videoContext); + if (error) + return "videoContext." + error; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates an AnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest} AnnotateVideoRequest + */ + AnnotateVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.inputContent != null) + if (typeof object.inputContent === "string") + $util.base64.decode(object.inputContent, message.inputContent = $util.newBuffer($util.base64.length(object.inputContent)), 0); + else if (object.inputContent.length >= 0) + message.inputContent = object.inputContent; + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + switch (object.features[i]) { + default: + if (typeof object.features[i] === "number") { + message.features[i] = object.features[i]; + break; + } + case "FEATURE_UNSPECIFIED": + case 0: + message.features[i] = 0; + break; + case "LABEL_DETECTION": + case 1: + message.features[i] = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.features[i] = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.features[i] = 3; + break; + case "FACE_DETECTION": + case 4: + message.features[i] = 4; + break; + case "SPEECH_TRANSCRIPTION": + case 6: + message.features[i] = 6; + break; + case "TEXT_DETECTION": + case 7: + message.features[i] = 7; + break; + case "OBJECT_TRACKING": + case 9: + message.features[i] = 9; + break; + case "LOGO_RECOGNITION": + case 12: + message.features[i] = 12; + break; + case "CELEBRITY_RECOGNITION": + case 13: + message.features[i] = 13; + break; + case "PERSON_DETECTION": + case 14: + message.features[i] = 14; + break; + } + } + if (object.videoContext != null) { + if (typeof object.videoContext !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.videoContext: object expected"); + message.videoContext = $root.google.cloud.videointelligence.v1p3beta1.VideoContext.fromObject(object.videoContext); + } + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest} message AnnotateVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (options.defaults) { + object.inputUri = ""; + object.videoContext = null; + object.outputUri = ""; + object.locationId = ""; + if (options.bytes === String) + object.inputContent = ""; + else { + object.inputContent = []; + if (options.bytes !== Array) + object.inputContent = $util.newBuffer(object.inputContent); + } + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = options.enums === String ? $root.google.cloud.videointelligence.v1p3beta1.Feature[message.features[j]] === undefined ? message.features[j] : $root.google.cloud.videointelligence.v1p3beta1.Feature[message.features[j]] : message.features[j]; + } + if (message.videoContext != null && message.hasOwnProperty("videoContext")) + object.videoContext = $root.google.cloud.videointelligence.v1p3beta1.VideoContext.toObject(message.videoContext, options); + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.inputContent != null && message.hasOwnProperty("inputContent")) + object.inputContent = options.bytes === String ? $util.base64.encode(message.inputContent, 0, message.inputContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputContent) : message.inputContent; + return object; + }; + + /** + * Converts this AnnotateVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoRequest + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest"; + }; + + return AnnotateVideoRequest; + })(); + + v1p3beta1.VideoContext = (function() { + + /** + * Properties of a VideoContext. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IVideoContext + * @property {Array.|null} [segments] VideoContext segments + * @property {google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig|null} [labelDetectionConfig] VideoContext labelDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig|null} [shotChangeDetectionConfig] VideoContext shotChangeDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig|null} [explicitContentDetectionConfig] VideoContext explicitContentDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig|null} [faceDetectionConfig] VideoContext faceDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig|null} [speechTranscriptionConfig] VideoContext speechTranscriptionConfig + * @property {google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig|null} [textDetectionConfig] VideoContext textDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig|null} [personDetectionConfig] VideoContext personDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig|null} [objectTrackingConfig] VideoContext objectTrackingConfig + */ + + /** + * Constructs a new VideoContext. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a VideoContext. + * @implements IVideoContext + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IVideoContext=} [properties] Properties to set + */ + function VideoContext(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoContext segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.segments = $util.emptyArray; + + /** + * VideoContext labelDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig|null|undefined} labelDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.labelDetectionConfig = null; + + /** + * VideoContext shotChangeDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig|null|undefined} shotChangeDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.shotChangeDetectionConfig = null; + + /** + * VideoContext explicitContentDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig|null|undefined} explicitContentDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.explicitContentDetectionConfig = null; + + /** + * VideoContext faceDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig|null|undefined} faceDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.faceDetectionConfig = null; + + /** + * VideoContext speechTranscriptionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig|null|undefined} speechTranscriptionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.speechTranscriptionConfig = null; + + /** + * VideoContext textDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig|null|undefined} textDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.textDetectionConfig = null; + + /** + * VideoContext personDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig|null|undefined} personDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.personDetectionConfig = null; + + /** + * VideoContext objectTrackingConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig|null|undefined} objectTrackingConfig + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + */ + VideoContext.prototype.objectTrackingConfig = null; + + /** + * Creates a new VideoContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.VideoContext} VideoContext instance + */ + VideoContext.create = function create(properties) { + return new VideoContext(properties); + }; + + /** + * Encodes the specified VideoContext message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labelDetectionConfig != null && Object.hasOwnProperty.call(message, "labelDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.encode(message.labelDetectionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotChangeDetectionConfig != null && Object.hasOwnProperty.call(message, "shotChangeDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.encode(message.shotChangeDetectionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explicitContentDetectionConfig != null && Object.hasOwnProperty.call(message, "explicitContentDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.encode(message.explicitContentDetectionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.faceDetectionConfig != null && Object.hasOwnProperty.call(message, "faceDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.encode(message.faceDetectionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.speechTranscriptionConfig != null && Object.hasOwnProperty.call(message, "speechTranscriptionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.encode(message.speechTranscriptionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textDetectionConfig != null && Object.hasOwnProperty.call(message, "textDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.encode(message.textDetectionConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.personDetectionConfig != null && Object.hasOwnProperty.call(message, "personDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.encode(message.personDetectionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.objectTrackingConfig != null && Object.hasOwnProperty.call(message, "objectTrackingConfig")) + $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.encode(message.objectTrackingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoContext} message VideoContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decode = function 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.videointelligence.v1p3beta1.VideoContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.faceDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.textDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.personDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.objectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.VideoContext} VideoContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.verify(message.labelDetectionConfig); + if (error) + return "labelDetectionConfig." + error; + } + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.verify(message.shotChangeDetectionConfig); + if (error) + return "shotChangeDetectionConfig." + error; + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.verify(message.explicitContentDetectionConfig); + if (error) + return "explicitContentDetectionConfig." + error; + } + if (message.faceDetectionConfig != null && message.hasOwnProperty("faceDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.verify(message.faceDetectionConfig); + if (error) + return "faceDetectionConfig." + error; + } + if (message.speechTranscriptionConfig != null && message.hasOwnProperty("speechTranscriptionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.verify(message.speechTranscriptionConfig); + if (error) + return "speechTranscriptionConfig." + error; + } + if (message.textDetectionConfig != null && message.hasOwnProperty("textDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.verify(message.textDetectionConfig); + if (error) + return "textDetectionConfig." + error; + } + if (message.personDetectionConfig != null && message.hasOwnProperty("personDetectionConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.verify(message.personDetectionConfig); + if (error) + return "personDetectionConfig." + error; + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.verify(message.objectTrackingConfig); + if (error) + return "objectTrackingConfig." + error; + } + return null; + }; + + /** + * Creates a VideoContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.VideoContext} VideoContext + */ + VideoContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.VideoContext) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.VideoContext(); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segments[i]); + } + } + if (object.labelDetectionConfig != null) { + if (typeof object.labelDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.labelDetectionConfig: object expected"); + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.fromObject(object.labelDetectionConfig); + } + if (object.shotChangeDetectionConfig != null) { + if (typeof object.shotChangeDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.shotChangeDetectionConfig: object expected"); + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.fromObject(object.shotChangeDetectionConfig); + } + if (object.explicitContentDetectionConfig != null) { + if (typeof object.explicitContentDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.explicitContentDetectionConfig: object expected"); + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.fromObject(object.explicitContentDetectionConfig); + } + if (object.faceDetectionConfig != null) { + if (typeof object.faceDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.faceDetectionConfig: object expected"); + message.faceDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.fromObject(object.faceDetectionConfig); + } + if (object.speechTranscriptionConfig != null) { + if (typeof object.speechTranscriptionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.speechTranscriptionConfig: object expected"); + message.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.fromObject(object.speechTranscriptionConfig); + } + if (object.textDetectionConfig != null) { + if (typeof object.textDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.textDetectionConfig: object expected"); + message.textDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.fromObject(object.textDetectionConfig); + } + if (object.personDetectionConfig != null) { + if (typeof object.personDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.personDetectionConfig: object expected"); + message.personDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.fromObject(object.personDetectionConfig); + } + if (object.objectTrackingConfig != null) { + if (typeof object.objectTrackingConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoContext.objectTrackingConfig: object expected"); + message.objectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.fromObject(object.objectTrackingConfig); + } + return message; + }; + + /** + * Creates a plain object from a VideoContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.VideoContext} message VideoContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) { + object.labelDetectionConfig = null; + object.shotChangeDetectionConfig = null; + object.explicitContentDetectionConfig = null; + object.faceDetectionConfig = null; + object.speechTranscriptionConfig = null; + object.textDetectionConfig = null; + object.personDetectionConfig = null; + object.objectTrackingConfig = null; + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segments[j], options); + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) + object.labelDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.toObject(message.labelDetectionConfig, options); + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) + object.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.toObject(message.shotChangeDetectionConfig, options); + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) + object.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.toObject(message.explicitContentDetectionConfig, options); + if (message.faceDetectionConfig != null && message.hasOwnProperty("faceDetectionConfig")) + object.faceDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.toObject(message.faceDetectionConfig, options); + if (message.speechTranscriptionConfig != null && message.hasOwnProperty("speechTranscriptionConfig")) + object.speechTranscriptionConfig = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.toObject(message.speechTranscriptionConfig, options); + if (message.textDetectionConfig != null && message.hasOwnProperty("textDetectionConfig")) + object.textDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.toObject(message.textDetectionConfig, options); + if (message.personDetectionConfig != null && message.hasOwnProperty("personDetectionConfig")) + object.personDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.toObject(message.personDetectionConfig, options); + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) + object.objectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.toObject(message.objectTrackingConfig, options); + return object; + }; + + /** + * Converts this VideoContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @instance + * @returns {Object.} JSON object + */ + VideoContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.VideoContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.VideoContext"; + }; + + return VideoContext; + })(); + + /** + * LabelDetectionMode enum. + * @name google.cloud.videointelligence.v1p3beta1.LabelDetectionMode + * @enum {number} + * @property {number} LABEL_DETECTION_MODE_UNSPECIFIED=0 LABEL_DETECTION_MODE_UNSPECIFIED value + * @property {number} SHOT_MODE=1 SHOT_MODE value + * @property {number} FRAME_MODE=2 FRAME_MODE value + * @property {number} SHOT_AND_FRAME_MODE=3 SHOT_AND_FRAME_MODE value + */ + v1p3beta1.LabelDetectionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LABEL_DETECTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOT_MODE"] = 1; + values[valuesById[2] = "FRAME_MODE"] = 2; + values[valuesById[3] = "SHOT_AND_FRAME_MODE"] = 3; + return values; + })(); + + /** + * Likelihood enum. + * @name google.cloud.videointelligence.v1p3beta1.Likelihood + * @enum {number} + * @property {number} LIKELIHOOD_UNSPECIFIED=0 LIKELIHOOD_UNSPECIFIED value + * @property {number} VERY_UNLIKELY=1 VERY_UNLIKELY value + * @property {number} UNLIKELY=2 UNLIKELY value + * @property {number} POSSIBLE=3 POSSIBLE value + * @property {number} LIKELY=4 LIKELY value + * @property {number} VERY_LIKELY=5 VERY_LIKELY value + */ + v1p3beta1.Likelihood = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIKELIHOOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERY_UNLIKELY"] = 1; + values[valuesById[2] = "UNLIKELY"] = 2; + values[valuesById[3] = "POSSIBLE"] = 3; + values[valuesById[4] = "LIKELY"] = 4; + values[valuesById[5] = "VERY_LIKELY"] = 5; + return values; + })(); + + v1p3beta1.LabelDetectionConfig = (function() { + + /** + * Properties of a LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ILabelDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.LabelDetectionMode|null} [labelDetectionMode] LabelDetectionConfig labelDetectionMode + * @property {boolean|null} [stationaryCamera] LabelDetectionConfig stationaryCamera + * @property {string|null} [model] LabelDetectionConfig model + * @property {number|null} [frameConfidenceThreshold] LabelDetectionConfig frameConfidenceThreshold + * @property {number|null} [videoConfidenceThreshold] LabelDetectionConfig videoConfidenceThreshold + */ + + /** + * Constructs a new LabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a LabelDetectionConfig. + * @implements ILabelDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig=} [properties] Properties to set + */ + function LabelDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelDetectionConfig labelDetectionMode. + * @member {google.cloud.videointelligence.v1p3beta1.LabelDetectionMode} labelDetectionMode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.labelDetectionMode = 0; + + /** + * LabelDetectionConfig stationaryCamera. + * @member {boolean} stationaryCamera + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.stationaryCamera = false; + + /** + * LabelDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.model = ""; + + /** + * LabelDetectionConfig frameConfidenceThreshold. + * @member {number} frameConfidenceThreshold + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.frameConfidenceThreshold = 0; + + /** + * LabelDetectionConfig videoConfidenceThreshold. + * @member {number} videoConfidenceThreshold + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @instance + */ + LabelDetectionConfig.prototype.videoConfidenceThreshold = 0; + + /** + * Creates a new LabelDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig} LabelDetectionConfig instance + */ + LabelDetectionConfig.create = function create(properties) { + return new LabelDetectionConfig(properties); + }; + + /** + * Encodes the specified LabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelDetectionMode != null && Object.hasOwnProperty.call(message, "labelDetectionMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelDetectionMode); + if (message.stationaryCamera != null && Object.hasOwnProperty.call(message, "stationaryCamera")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.stationaryCamera); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + if (message.frameConfidenceThreshold != null && Object.hasOwnProperty.call(message, "frameConfidenceThreshold")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.frameConfidenceThreshold); + if (message.videoConfidenceThreshold != null && Object.hasOwnProperty.call(message, "videoConfidenceThreshold")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.videoConfidenceThreshold); + return writer; + }; + + /** + * Encodes the specified LabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelDetectionConfig} message LabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decode = function 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.videointelligence.v1p3beta1.LabelDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelDetectionMode = reader.int32(); + break; + } + case 2: { + message.stationaryCamera = reader.bool(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + case 4: { + message.frameConfidenceThreshold = reader.float(); + break; + } + case 5: { + message.videoConfidenceThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig} LabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + switch (message.labelDetectionMode) { + default: + return "labelDetectionMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + if (typeof message.stationaryCamera !== "boolean") + return "stationaryCamera: boolean expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.frameConfidenceThreshold != null && message.hasOwnProperty("frameConfidenceThreshold")) + if (typeof message.frameConfidenceThreshold !== "number") + return "frameConfidenceThreshold: number expected"; + if (message.videoConfidenceThreshold != null && message.hasOwnProperty("videoConfidenceThreshold")) + if (typeof message.videoConfidenceThreshold !== "number") + return "videoConfidenceThreshold: number expected"; + return null; + }; + + /** + * Creates a LabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig} LabelDetectionConfig + */ + LabelDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig(); + switch (object.labelDetectionMode) { + default: + if (typeof object.labelDetectionMode === "number") { + message.labelDetectionMode = object.labelDetectionMode; + break; + } + break; + case "LABEL_DETECTION_MODE_UNSPECIFIED": + case 0: + message.labelDetectionMode = 0; + break; + case "SHOT_MODE": + case 1: + message.labelDetectionMode = 1; + break; + case "FRAME_MODE": + case 2: + message.labelDetectionMode = 2; + break; + case "SHOT_AND_FRAME_MODE": + case 3: + message.labelDetectionMode = 3; + break; + } + if (object.stationaryCamera != null) + message.stationaryCamera = Boolean(object.stationaryCamera); + if (object.model != null) + message.model = String(object.model); + if (object.frameConfidenceThreshold != null) + message.frameConfidenceThreshold = Number(object.frameConfidenceThreshold); + if (object.videoConfidenceThreshold != null) + message.videoConfidenceThreshold = Number(object.videoConfidenceThreshold); + return message; + }; + + /** + * Creates a plain object from a LabelDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig} message LabelDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelDetectionMode = options.enums === String ? "LABEL_DETECTION_MODE_UNSPECIFIED" : 0; + object.stationaryCamera = false; + object.model = ""; + object.frameConfidenceThreshold = 0; + object.videoConfidenceThreshold = 0; + } + if (message.labelDetectionMode != null && message.hasOwnProperty("labelDetectionMode")) + object.labelDetectionMode = options.enums === String ? $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionMode[message.labelDetectionMode] === undefined ? message.labelDetectionMode : $root.google.cloud.videointelligence.v1p3beta1.LabelDetectionMode[message.labelDetectionMode] : message.labelDetectionMode; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + object.stationaryCamera = message.stationaryCamera; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.frameConfidenceThreshold != null && message.hasOwnProperty("frameConfidenceThreshold")) + object.frameConfidenceThreshold = options.json && !isFinite(message.frameConfidenceThreshold) ? String(message.frameConfidenceThreshold) : message.frameConfidenceThreshold; + if (message.videoConfidenceThreshold != null && message.hasOwnProperty("videoConfidenceThreshold")) + object.videoConfidenceThreshold = options.json && !isFinite(message.videoConfidenceThreshold) ? String(message.videoConfidenceThreshold) : message.videoConfidenceThreshold; + return object; + }; + + /** + * Converts this LabelDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + LabelDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig"; + }; + + return LabelDetectionConfig; + })(); + + /** + * StreamingFeature enum. + * @name google.cloud.videointelligence.v1p3beta1.StreamingFeature + * @enum {number} + * @property {number} STREAMING_FEATURE_UNSPECIFIED=0 STREAMING_FEATURE_UNSPECIFIED value + * @property {number} STREAMING_LABEL_DETECTION=1 STREAMING_LABEL_DETECTION value + * @property {number} STREAMING_SHOT_CHANGE_DETECTION=2 STREAMING_SHOT_CHANGE_DETECTION value + * @property {number} STREAMING_EXPLICIT_CONTENT_DETECTION=3 STREAMING_EXPLICIT_CONTENT_DETECTION value + * @property {number} STREAMING_OBJECT_TRACKING=4 STREAMING_OBJECT_TRACKING value + * @property {number} STREAMING_AUTOML_ACTION_RECOGNITION=23 STREAMING_AUTOML_ACTION_RECOGNITION value + * @property {number} STREAMING_AUTOML_CLASSIFICATION=21 STREAMING_AUTOML_CLASSIFICATION value + * @property {number} STREAMING_AUTOML_OBJECT_TRACKING=22 STREAMING_AUTOML_OBJECT_TRACKING value + */ + v1p3beta1.StreamingFeature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STREAMING_FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STREAMING_LABEL_DETECTION"] = 1; + values[valuesById[2] = "STREAMING_SHOT_CHANGE_DETECTION"] = 2; + values[valuesById[3] = "STREAMING_EXPLICIT_CONTENT_DETECTION"] = 3; + values[valuesById[4] = "STREAMING_OBJECT_TRACKING"] = 4; + values[valuesById[23] = "STREAMING_AUTOML_ACTION_RECOGNITION"] = 23; + values[valuesById[21] = "STREAMING_AUTOML_CLASSIFICATION"] = 21; + values[valuesById[22] = "STREAMING_AUTOML_OBJECT_TRACKING"] = 22; + return values; + })(); + + /** + * Feature enum. + * @name google.cloud.videointelligence.v1p3beta1.Feature + * @enum {number} + * @property {number} FEATURE_UNSPECIFIED=0 FEATURE_UNSPECIFIED value + * @property {number} LABEL_DETECTION=1 LABEL_DETECTION value + * @property {number} SHOT_CHANGE_DETECTION=2 SHOT_CHANGE_DETECTION value + * @property {number} EXPLICIT_CONTENT_DETECTION=3 EXPLICIT_CONTENT_DETECTION value + * @property {number} FACE_DETECTION=4 FACE_DETECTION value + * @property {number} SPEECH_TRANSCRIPTION=6 SPEECH_TRANSCRIPTION value + * @property {number} TEXT_DETECTION=7 TEXT_DETECTION value + * @property {number} OBJECT_TRACKING=9 OBJECT_TRACKING value + * @property {number} LOGO_RECOGNITION=12 LOGO_RECOGNITION value + * @property {number} CELEBRITY_RECOGNITION=13 CELEBRITY_RECOGNITION value + * @property {number} PERSON_DETECTION=14 PERSON_DETECTION value + */ + v1p3beta1.Feature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LABEL_DETECTION"] = 1; + values[valuesById[2] = "SHOT_CHANGE_DETECTION"] = 2; + values[valuesById[3] = "EXPLICIT_CONTENT_DETECTION"] = 3; + values[valuesById[4] = "FACE_DETECTION"] = 4; + values[valuesById[6] = "SPEECH_TRANSCRIPTION"] = 6; + values[valuesById[7] = "TEXT_DETECTION"] = 7; + values[valuesById[9] = "OBJECT_TRACKING"] = 9; + values[valuesById[12] = "LOGO_RECOGNITION"] = 12; + values[valuesById[13] = "CELEBRITY_RECOGNITION"] = 13; + values[valuesById[14] = "PERSON_DETECTION"] = 14; + return values; + })(); + + v1p3beta1.ShotChangeDetectionConfig = (function() { + + /** + * Properties of a ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IShotChangeDetectionConfig + * @property {string|null} [model] ShotChangeDetectionConfig model + */ + + /** + * Constructs a new ShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a ShotChangeDetectionConfig. + * @implements IShotChangeDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig=} [properties] Properties to set + */ + function ShotChangeDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShotChangeDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @instance + */ + ShotChangeDetectionConfig.prototype.model = ""; + + /** + * Creates a new ShotChangeDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig instance + */ + ShotChangeDetectionConfig.create = function create(properties) { + return new ShotChangeDetectionConfig(properties); + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IShotChangeDetectionConfig} message ShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShotChangeDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decode = function 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.videointelligence.v1p3beta1.ShotChangeDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShotChangeDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShotChangeDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShotChangeDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a ShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig} ShotChangeDetectionConfig + */ + ShotChangeDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a ShotChangeDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig} message ShotChangeDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShotChangeDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ShotChangeDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ShotChangeDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShotChangeDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShotChangeDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig"; + }; + + return ShotChangeDetectionConfig; + })(); + + v1p3beta1.ObjectTrackingConfig = (function() { + + /** + * Properties of an ObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IObjectTrackingConfig + * @property {string|null} [model] ObjectTrackingConfig model + */ + + /** + * Constructs a new ObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an ObjectTrackingConfig. + * @implements IObjectTrackingConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig=} [properties] Properties to set + */ + function ObjectTrackingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @instance + */ + ObjectTrackingConfig.prototype.model = ""; + + /** + * Creates a new ObjectTrackingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig} ObjectTrackingConfig instance + */ + ObjectTrackingConfig.create = function create(properties) { + return new ObjectTrackingConfig(properties); + }; + + /** + * Encodes the specified ObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig} message ObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingConfig} message ObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig} ObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingConfig.decode = function 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.videointelligence.v1p3beta1.ObjectTrackingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig} ObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig} ObjectTrackingConfig + */ + ObjectTrackingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig} message ObjectTrackingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ObjectTrackingConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig"; + }; + + return ObjectTrackingConfig; + })(); + + v1p3beta1.ExplicitContentDetectionConfig = (function() { + + /** + * Properties of an ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IExplicitContentDetectionConfig + * @property {string|null} [model] ExplicitContentDetectionConfig model + */ + + /** + * Constructs a new ExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an ExplicitContentDetectionConfig. + * @implements IExplicitContentDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig=} [properties] Properties to set + */ + function ExplicitContentDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @instance + */ + ExplicitContentDetectionConfig.prototype.model = ""; + + /** + * Creates a new ExplicitContentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig instance + */ + ExplicitContentDetectionConfig.create = function create(properties) { + return new ExplicitContentDetectionConfig(properties); + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentDetectionConfig} message ExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decode = function 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.videointelligence.v1p3beta1.ExplicitContentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates an ExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig} ExplicitContentDetectionConfig + */ + ExplicitContentDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from an ExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig} message ExplicitContentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ExplicitContentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig"; + }; + + return ExplicitContentDetectionConfig; + })(); + + v1p3beta1.FaceDetectionConfig = (function() { + + /** + * Properties of a FaceDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IFaceDetectionConfig + * @property {string|null} [model] FaceDetectionConfig model + * @property {boolean|null} [includeBoundingBoxes] FaceDetectionConfig includeBoundingBoxes + * @property {boolean|null} [includeAttributes] FaceDetectionConfig includeAttributes + */ + + /** + * Constructs a new FaceDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a FaceDetectionConfig. + * @implements IFaceDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig=} [properties] Properties to set + */ + function FaceDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.model = ""; + + /** + * FaceDetectionConfig includeBoundingBoxes. + * @member {boolean} includeBoundingBoxes + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.includeBoundingBoxes = false; + + /** + * FaceDetectionConfig includeAttributes. + * @member {boolean} includeAttributes + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @instance + */ + FaceDetectionConfig.prototype.includeAttributes = false; + + /** + * Creates a new FaceDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig} FaceDetectionConfig instance + */ + FaceDetectionConfig.create = function create(properties) { + return new FaceDetectionConfig(properties); + }; + + /** + * Encodes the specified FaceDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig} message FaceDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.includeBoundingBoxes != null && Object.hasOwnProperty.call(message, "includeBoundingBoxes")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeBoundingBoxes); + if (message.includeAttributes != null && Object.hasOwnProperty.call(message, "includeAttributes")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.includeAttributes); + return writer; + }; + + /** + * Encodes the specified FaceDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionConfig} message FaceDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig} FaceDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionConfig.decode = function 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.videointelligence.v1p3beta1.FaceDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.includeBoundingBoxes = reader.bool(); + break; + } + case 5: { + message.includeAttributes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig} FaceDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + if (typeof message.includeBoundingBoxes !== "boolean") + return "includeBoundingBoxes: boolean expected"; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + if (typeof message.includeAttributes !== "boolean") + return "includeAttributes: boolean expected"; + return null; + }; + + /** + * Creates a FaceDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig} FaceDetectionConfig + */ + FaceDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig(); + if (object.model != null) + message.model = String(object.model); + if (object.includeBoundingBoxes != null) + message.includeBoundingBoxes = Boolean(object.includeBoundingBoxes); + if (object.includeAttributes != null) + message.includeAttributes = Boolean(object.includeAttributes); + return message; + }; + + /** + * Creates a plain object from a FaceDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig} message FaceDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.includeBoundingBoxes = false; + object.includeAttributes = false; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + object.includeBoundingBoxes = message.includeBoundingBoxes; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + object.includeAttributes = message.includeAttributes; + return object; + }; + + /** + * Converts this FaceDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + FaceDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.FaceDetectionConfig"; + }; + + return FaceDetectionConfig; + })(); + + v1p3beta1.PersonDetectionConfig = (function() { + + /** + * Properties of a PersonDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IPersonDetectionConfig + * @property {boolean|null} [includeBoundingBoxes] PersonDetectionConfig includeBoundingBoxes + * @property {boolean|null} [includePoseLandmarks] PersonDetectionConfig includePoseLandmarks + * @property {boolean|null} [includeAttributes] PersonDetectionConfig includeAttributes + */ + + /** + * Constructs a new PersonDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a PersonDetectionConfig. + * @implements IPersonDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig=} [properties] Properties to set + */ + function PersonDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonDetectionConfig includeBoundingBoxes. + * @member {boolean} includeBoundingBoxes + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @instance + */ + PersonDetectionConfig.prototype.includeBoundingBoxes = false; + + /** + * PersonDetectionConfig includePoseLandmarks. + * @member {boolean} includePoseLandmarks + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @instance + */ + PersonDetectionConfig.prototype.includePoseLandmarks = false; + + /** + * PersonDetectionConfig includeAttributes. + * @member {boolean} includeAttributes + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @instance + */ + PersonDetectionConfig.prototype.includeAttributes = false; + + /** + * Creates a new PersonDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig} PersonDetectionConfig instance + */ + PersonDetectionConfig.create = function create(properties) { + return new PersonDetectionConfig(properties); + }; + + /** + * Encodes the specified PersonDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig} message PersonDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.includeBoundingBoxes != null && Object.hasOwnProperty.call(message, "includeBoundingBoxes")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.includeBoundingBoxes); + if (message.includePoseLandmarks != null && Object.hasOwnProperty.call(message, "includePoseLandmarks")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includePoseLandmarks); + if (message.includeAttributes != null && Object.hasOwnProperty.call(message, "includeAttributes")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.includeAttributes); + return writer; + }; + + /** + * Encodes the specified PersonDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionConfig} message PersonDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig} PersonDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionConfig.decode = function 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.videointelligence.v1p3beta1.PersonDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.includeBoundingBoxes = reader.bool(); + break; + } + case 2: { + message.includePoseLandmarks = reader.bool(); + break; + } + case 3: { + message.includeAttributes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig} PersonDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + if (typeof message.includeBoundingBoxes !== "boolean") + return "includeBoundingBoxes: boolean expected"; + if (message.includePoseLandmarks != null && message.hasOwnProperty("includePoseLandmarks")) + if (typeof message.includePoseLandmarks !== "boolean") + return "includePoseLandmarks: boolean expected"; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + if (typeof message.includeAttributes !== "boolean") + return "includeAttributes: boolean expected"; + return null; + }; + + /** + * Creates a PersonDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig} PersonDetectionConfig + */ + PersonDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig(); + if (object.includeBoundingBoxes != null) + message.includeBoundingBoxes = Boolean(object.includeBoundingBoxes); + if (object.includePoseLandmarks != null) + message.includePoseLandmarks = Boolean(object.includePoseLandmarks); + if (object.includeAttributes != null) + message.includeAttributes = Boolean(object.includeAttributes); + return message; + }; + + /** + * Creates a plain object from a PersonDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig} message PersonDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.includeBoundingBoxes = false; + object.includePoseLandmarks = false; + object.includeAttributes = false; + } + if (message.includeBoundingBoxes != null && message.hasOwnProperty("includeBoundingBoxes")) + object.includeBoundingBoxes = message.includeBoundingBoxes; + if (message.includePoseLandmarks != null && message.hasOwnProperty("includePoseLandmarks")) + object.includePoseLandmarks = message.includePoseLandmarks; + if (message.includeAttributes != null && message.hasOwnProperty("includeAttributes")) + object.includeAttributes = message.includeAttributes; + return object; + }; + + /** + * Converts this PersonDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + PersonDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.PersonDetectionConfig"; + }; + + return PersonDetectionConfig; + })(); + + v1p3beta1.TextDetectionConfig = (function() { + + /** + * Properties of a TextDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ITextDetectionConfig + * @property {Array.|null} [languageHints] TextDetectionConfig languageHints + * @property {string|null} [model] TextDetectionConfig model + */ + + /** + * Constructs a new TextDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a TextDetectionConfig. + * @implements ITextDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig=} [properties] Properties to set + */ + function TextDetectionConfig(properties) { + this.languageHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextDetectionConfig languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @instance + */ + TextDetectionConfig.prototype.languageHints = $util.emptyArray; + + /** + * TextDetectionConfig model. + * @member {string} model + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @instance + */ + TextDetectionConfig.prototype.model = ""; + + /** + * Creates a new TextDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.TextDetectionConfig} TextDetectionConfig instance + */ + TextDetectionConfig.create = function create(properties) { + return new TextDetectionConfig(properties); + }; + + /** + * Encodes the specified TextDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig} message TextDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + return writer; + }; + + /** + * Encodes the specified TextDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextDetectionConfig} message TextDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.TextDetectionConfig} TextDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextDetectionConfig.decode = function 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.videointelligence.v1p3beta1.TextDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + } + case 2: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.TextDetectionConfig} TextDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a TextDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.TextDetectionConfig} TextDetectionConfig + */ + TextDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig(); + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a TextDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.TextDetectionConfig} message TextDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (options.defaults) + object.model = ""; + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this TextDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + TextDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.TextDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.TextDetectionConfig"; + }; + + return TextDetectionConfig; + })(); + + v1p3beta1.VideoSegment = (function() { + + /** + * Properties of a VideoSegment. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IVideoSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] VideoSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] VideoSegment endTimeOffset + */ + + /** + * Constructs a new VideoSegment. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a VideoSegment. + * @implements IVideoSegment + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IVideoSegment=} [properties] Properties to set + */ + function VideoSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @instance + */ + VideoSegment.prototype.startTimeOffset = null; + + /** + * VideoSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @instance + */ + VideoSegment.prototype.endTimeOffset = null; + + /** + * Creates a new VideoSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.VideoSegment} VideoSegment instance + */ + VideoSegment.create = function create(properties) { + return new VideoSegment(properties); + }; + + /** + * Encodes the specified VideoSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.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(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoSegment} message VideoSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decode = function 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.videointelligence.v1p3beta1.VideoSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.VideoSegment} VideoSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoSegment.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; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates a VideoSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.VideoSegment} VideoSegment + */ + VideoSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.VideoSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.VideoSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoSegment.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.videointelligence.v1p3beta1.VideoSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a VideoSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.VideoSegment} message VideoSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeOffset = null; + object.endTimeOffset = null; + } + 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 VideoSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @instance + * @returns {Object.} JSON object + */ + VideoSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.VideoSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.VideoSegment"; + }; + + return VideoSegment; + })(); + + v1p3beta1.LabelSegment = (function() { + + /** + * Properties of a LabelSegment. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ILabelSegment + * @property {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null} [segment] LabelSegment segment + * @property {number|null} [confidence] LabelSegment confidence + */ + + /** + * Constructs a new LabelSegment. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a LabelSegment. + * @implements ILabelSegment + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ILabelSegment=} [properties] Properties to set + */ + function LabelSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelSegment segment. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @instance + */ + LabelSegment.prototype.segment = null; + + /** + * LabelSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @instance + */ + LabelSegment.prototype.confidence = 0; + + /** + * Creates a new LabelSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.LabelSegment} LabelSegment instance + */ + LabelSegment.create = function create(properties) { + return new LabelSegment(properties); + }; + + /** + * Encodes the specified LabelSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelSegment} message LabelSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decode = function 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.videointelligence.v1p3beta1.LabelSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.LabelSegment} LabelSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.LabelSegment} LabelSegment + */ + LabelSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.LabelSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.LabelSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.LabelSegment} message LabelSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @instance + * @returns {Object.} JSON object + */ + LabelSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.LabelSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.LabelSegment"; + }; + + return LabelSegment; + })(); + + v1p3beta1.LabelFrame = (function() { + + /** + * Properties of a LabelFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ILabelFrame + * @property {google.protobuf.IDuration|null} [timeOffset] LabelFrame timeOffset + * @property {number|null} [confidence] LabelFrame confidence + */ + + /** + * Constructs a new LabelFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a LabelFrame. + * @implements ILabelFrame + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ILabelFrame=} [properties] Properties to set + */ + function LabelFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @instance + */ + LabelFrame.prototype.timeOffset = null; + + /** + * LabelFrame confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @instance + */ + LabelFrame.prototype.confidence = 0; + + /** + * Creates a new LabelFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.LabelFrame} LabelFrame instance + */ + LabelFrame.create = function create(properties) { + return new LabelFrame(properties); + }; + + /** + * Encodes the specified LabelFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified LabelFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelFrame} message LabelFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decode = function 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.videointelligence.v1p3beta1.LabelFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.LabelFrame} LabelFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a LabelFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.LabelFrame} LabelFrame + */ + LabelFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.LabelFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.LabelFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a LabelFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.LabelFrame} message LabelFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.confidence = 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this LabelFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @instance + * @returns {Object.} JSON object + */ + LabelFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.LabelFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.LabelFrame"; + }; + + return LabelFrame; + })(); + + v1p3beta1.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IEntity + * @property {string|null} [entityId] Entity entityId + * @property {string|null} [description] Entity description + * @property {string|null} [languageCode] Entity languageCode + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity entityId. + * @member {string} entityId + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @instance + */ + Entity.prototype.entityId = ""; + + /** + * Entity description. + * @member {string} description + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @instance + */ + Entity.prototype.description = ""; + + /** + * Entity languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @instance + */ + Entity.prototype.languageCode = ""; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IEntity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityId != null && Object.hasOwnProperty.call(message, "entityId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entityId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function 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.videointelligence.v1p3beta1.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityId = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityId != null && message.hasOwnProperty("entityId")) + if (!$util.isString(message.entityId)) + return "entityId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.Entity) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.Entity(); + if (object.entityId != null) + message.entityId = String(object.entityId); + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityId = ""; + object.description = ""; + object.languageCode = ""; + } + if (message.entityId != null && message.hasOwnProperty("entityId")) + object.entityId = message.entityId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.Entity"; + }; + + return Entity; + })(); + + v1p3beta1.LabelAnnotation = (function() { + + /** + * Properties of a LabelAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ILabelAnnotation + * @property {google.cloud.videointelligence.v1p3beta1.IEntity|null} [entity] LabelAnnotation entity + * @property {Array.|null} [categoryEntities] LabelAnnotation categoryEntities + * @property {Array.|null} [segments] LabelAnnotation segments + * @property {Array.|null} [frames] LabelAnnotation frames + */ + + /** + * Constructs a new LabelAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a LabelAnnotation. + * @implements ILabelAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ILabelAnnotation=} [properties] Properties to set + */ + function LabelAnnotation(properties) { + this.categoryEntities = []; + this.segments = []; + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LabelAnnotation entity. + * @member {google.cloud.videointelligence.v1p3beta1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.entity = null; + + /** + * LabelAnnotation categoryEntities. + * @member {Array.} categoryEntities + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.categoryEntities = $util.emptyArray; + + /** + * LabelAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.segments = $util.emptyArray; + + /** + * LabelAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @instance + */ + LabelAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new LabelAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.LabelAnnotation} LabelAnnotation instance + */ + LabelAnnotation.create = function create(properties) { + return new LabelAnnotation(properties); + }; + + /** + * Encodes the specified LabelAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1p3beta1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.categoryEntities != null && message.categoryEntities.length) + for (var i = 0; i < message.categoryEntities.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.Entity.encode(message.categoryEntities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelFrame.encode(message.frames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LabelAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILabelAnnotation} message LabelAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decode = function 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.videointelligence.v1p3beta1.LabelAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.categoryEntities && message.categoryEntities.length)) + message.categoryEntities = []; + message.categoryEntities.push($root.google.cloud.videointelligence.v1p3beta1.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p3beta1.LabelSegment.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p3beta1.LabelFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LabelAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.LabelAnnotation} LabelAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.categoryEntities != null && message.hasOwnProperty("categoryEntities")) { + if (!Array.isArray(message.categoryEntities)) + return "categoryEntities: array expected"; + for (var i = 0; i < message.categoryEntities.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Entity.verify(message.categoryEntities[i]); + if (error) + return "categoryEntities." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a LabelAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.LabelAnnotation} LabelAnnotation + */ + LabelAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.fromObject(object.entity); + } + if (object.categoryEntities) { + if (!Array.isArray(object.categoryEntities)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.categoryEntities: array expected"); + message.categoryEntities = []; + for (var i = 0; i < object.categoryEntities.length; ++i) { + if (typeof object.categoryEntities[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.categoryEntities: object expected"); + message.categoryEntities[i] = $root.google.cloud.videointelligence.v1p3beta1.Entity.fromObject(object.categoryEntities[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelSegment.fromObject(object.segments[i]); + } + } + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LabelAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LabelAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.LabelAnnotation} message LabelAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categoryEntities = []; + object.segments = []; + object.frames = []; + } + if (options.defaults) + object.entity = null; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.toObject(message.entity, options); + if (message.categoryEntities && message.categoryEntities.length) { + object.categoryEntities = []; + for (var j = 0; j < message.categoryEntities.length; ++j) + object.categoryEntities[j] = $root.google.cloud.videointelligence.v1p3beta1.Entity.toObject(message.categoryEntities[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelSegment.toObject(message.segments[j], options); + } + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this LabelAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @instance + * @returns {Object.} JSON object + */ + LabelAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.LabelAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.LabelAnnotation"; + }; + + return LabelAnnotation; + })(); + + v1p3beta1.ExplicitContentFrame = (function() { + + /** + * Properties of an ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IExplicitContentFrame + * @property {google.protobuf.IDuration|null} [timeOffset] ExplicitContentFrame timeOffset + * @property {google.cloud.videointelligence.v1p3beta1.Likelihood|null} [pornographyLikelihood] ExplicitContentFrame pornographyLikelihood + */ + + /** + * Constructs a new ExplicitContentFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an ExplicitContentFrame. + * @implements IExplicitContentFrame + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame=} [properties] Properties to set + */ + function ExplicitContentFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.timeOffset = null; + + /** + * ExplicitContentFrame pornographyLikelihood. + * @member {google.cloud.videointelligence.v1p3beta1.Likelihood} pornographyLikelihood + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @instance + */ + ExplicitContentFrame.prototype.pornographyLikelihood = 0; + + /** + * Creates a new ExplicitContentFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame} ExplicitContentFrame instance + */ + ExplicitContentFrame.create = function create(properties) { + return new ExplicitContentFrame(properties); + }; + + /** + * Encodes the specified ExplicitContentFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pornographyLikelihood != null && Object.hasOwnProperty.call(message, "pornographyLikelihood")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pornographyLikelihood); + return writer; + }; + + /** + * Encodes the specified ExplicitContentFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentFrame} message ExplicitContentFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decode = function 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.videointelligence.v1p3beta1.ExplicitContentFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pornographyLikelihood = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame} ExplicitContentFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + switch (message.pornographyLikelihood) { + default: + return "pornographyLikelihood: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an ExplicitContentFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame} ExplicitContentFrame + */ + ExplicitContentFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame(); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + switch (object.pornographyLikelihood) { + default: + if (typeof object.pornographyLikelihood === "number") { + message.pornographyLikelihood = object.pornographyLikelihood; + break; + } + break; + case "LIKELIHOOD_UNSPECIFIED": + case 0: + message.pornographyLikelihood = 0; + break; + case "VERY_UNLIKELY": + case 1: + message.pornographyLikelihood = 1; + break; + case "UNLIKELY": + case 2: + message.pornographyLikelihood = 2; + break; + case "POSSIBLE": + case 3: + message.pornographyLikelihood = 3; + break; + case "LIKELY": + case 4: + message.pornographyLikelihood = 4; + break; + case "VERY_LIKELY": + case 5: + message.pornographyLikelihood = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame} message ExplicitContentFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.timeOffset = null; + object.pornographyLikelihood = options.enums === String ? "LIKELIHOOD_UNSPECIFIED" : 0; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.pornographyLikelihood != null && message.hasOwnProperty("pornographyLikelihood")) + object.pornographyLikelihood = options.enums === String ? $root.google.cloud.videointelligence.v1p3beta1.Likelihood[message.pornographyLikelihood] === undefined ? message.pornographyLikelihood : $root.google.cloud.videointelligence.v1p3beta1.Likelihood[message.pornographyLikelihood] : message.pornographyLikelihood; + return object; + }; + + /** + * Converts this ExplicitContentFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame"; + }; + + return ExplicitContentFrame; + })(); + + v1p3beta1.ExplicitContentAnnotation = (function() { + + /** + * Properties of an ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IExplicitContentAnnotation + * @property {Array.|null} [frames] ExplicitContentAnnotation frames + */ + + /** + * Constructs a new ExplicitContentAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an ExplicitContentAnnotation. + * @implements IExplicitContentAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation=} [properties] Properties to set + */ + function ExplicitContentAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplicitContentAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @instance + */ + ExplicitContentAnnotation.prototype.frames = $util.emptyArray; + + /** + * Creates a new ExplicitContentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation} ExplicitContentAnnotation instance + */ + ExplicitContentAnnotation.create = function create(properties) { + return new ExplicitContentAnnotation(properties); + }; + + /** + * Encodes the specified ExplicitContentAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.encode(message.frames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplicitContentAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation} message ExplicitContentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplicitContentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decode = function 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.videointelligence.v1p3beta1.ExplicitContentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplicitContentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplicitContentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplicitContentAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplicitContentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates an ExplicitContentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation} ExplicitContentAnnotation + */ + ExplicitContentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation(); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExplicitContentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation} message ExplicitContentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplicitContentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this ExplicitContentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @instance + * @returns {Object.} JSON object + */ + ExplicitContentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplicitContentAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplicitContentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation"; + }; + + return ExplicitContentAnnotation; + })(); + + v1p3beta1.NormalizedBoundingBox = (function() { + + /** + * Properties of a NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface INormalizedBoundingBox + * @property {number|null} [left] NormalizedBoundingBox left + * @property {number|null} [top] NormalizedBoundingBox top + * @property {number|null} [right] NormalizedBoundingBox right + * @property {number|null} [bottom] NormalizedBoundingBox bottom + */ + + /** + * Constructs a new NormalizedBoundingBox. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a NormalizedBoundingBox. + * @implements INormalizedBoundingBox + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox=} [properties] Properties to set + */ + function NormalizedBoundingBox(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingBox left. + * @member {number} left + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.left = 0; + + /** + * NormalizedBoundingBox top. + * @member {number} top + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.top = 0; + + /** + * NormalizedBoundingBox right. + * @member {number} right + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.right = 0; + + /** + * NormalizedBoundingBox bottom. + * @member {number} bottom + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @instance + */ + NormalizedBoundingBox.prototype.bottom = 0; + + /** + * Creates a new NormalizedBoundingBox instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox} NormalizedBoundingBox instance + */ + NormalizedBoundingBox.create = function create(properties) { + return new NormalizedBoundingBox(properties); + }; + + /** + * Encodes the specified NormalizedBoundingBox message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.left != null && Object.hasOwnProperty.call(message, "left")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.left); + if (message.top != null && Object.hasOwnProperty.call(message, "top")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.top); + if (message.right != null && Object.hasOwnProperty.call(message, "right")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.right); + if (message.bottom != null && Object.hasOwnProperty.call(message, "bottom")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.bottom); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingBox message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox} message NormalizedBoundingBox message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingBox.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decode = function 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.videointelligence.v1p3beta1.NormalizedBoundingBox(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.left = reader.float(); + break; + } + case 2: { + message.top = reader.float(); + break; + } + case 3: { + message.right = reader.float(); + break; + } + case 4: { + message.bottom = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingBox message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox} NormalizedBoundingBox + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingBox.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingBox message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingBox.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.left != null && message.hasOwnProperty("left")) + if (typeof message.left !== "number") + return "left: number expected"; + if (message.top != null && message.hasOwnProperty("top")) + if (typeof message.top !== "number") + return "top: number expected"; + if (message.right != null && message.hasOwnProperty("right")) + if (typeof message.right !== "number") + return "right: number expected"; + if (message.bottom != null && message.hasOwnProperty("bottom")) + if (typeof message.bottom !== "number") + return "bottom: number expected"; + return null; + }; + + /** + * Creates a NormalizedBoundingBox message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox} NormalizedBoundingBox + */ + NormalizedBoundingBox.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox(); + if (object.left != null) + message.left = Number(object.left); + if (object.top != null) + message.top = Number(object.top); + if (object.right != null) + message.right = Number(object.right); + if (object.bottom != null) + message.bottom = Number(object.bottom); + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingBox message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox} message NormalizedBoundingBox + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingBox.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.left = 0; + object.top = 0; + object.right = 0; + object.bottom = 0; + } + if (message.left != null && message.hasOwnProperty("left")) + object.left = options.json && !isFinite(message.left) ? String(message.left) : message.left; + if (message.top != null && message.hasOwnProperty("top")) + object.top = options.json && !isFinite(message.top) ? String(message.top) : message.top; + if (message.right != null && message.hasOwnProperty("right")) + object.right = options.json && !isFinite(message.right) ? String(message.right) : message.right; + if (message.bottom != null && message.hasOwnProperty("bottom")) + object.bottom = options.json && !isFinite(message.bottom) ? String(message.bottom) : message.bottom; + return object; + }; + + /** + * Converts this NormalizedBoundingBox to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingBox.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingBox + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingBox.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox"; + }; + + return NormalizedBoundingBox; + })(); + + v1p3beta1.TimestampedObject = (function() { + + /** + * Properties of a TimestampedObject. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ITimestampedObject + * @property {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null} [normalizedBoundingBox] TimestampedObject normalizedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] TimestampedObject timeOffset + * @property {Array.|null} [attributes] TimestampedObject attributes + * @property {Array.|null} [landmarks] TimestampedObject landmarks + */ + + /** + * Constructs a new TimestampedObject. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a TimestampedObject. + * @implements ITimestampedObject + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ITimestampedObject=} [properties] Properties to set + */ + function TimestampedObject(properties) { + this.attributes = []; + this.landmarks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampedObject normalizedBoundingBox. + * @member {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.normalizedBoundingBox = null; + + /** + * TimestampedObject timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.timeOffset = null; + + /** + * TimestampedObject attributes. + * @member {Array.} attributes + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.attributes = $util.emptyArray; + + /** + * TimestampedObject landmarks. + * @member {Array.} landmarks + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @instance + */ + TimestampedObject.prototype.landmarks = $util.emptyArray; + + /** + * Creates a new TimestampedObject instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITimestampedObject=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.TimestampedObject} TimestampedObject instance + */ + TimestampedObject.create = function create(properties) { + return new TimestampedObject(properties); + }; + + /** + * Encodes the specified TimestampedObject message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TimestampedObject.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITimestampedObject} message TimestampedObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampedObject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.encode(message.attributes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.landmarks != null && message.landmarks.length) + for (var i = 0; i < message.landmarks.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.encode(message.landmarks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimestampedObject message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TimestampedObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITimestampedObject} message TimestampedObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampedObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.TimestampedObject} TimestampedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampedObject.decode = function 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.videointelligence.v1p3beta1.TimestampedObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.landmarks && message.landmarks.length)) + message.landmarks = []; + message.landmarks.push($root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampedObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.TimestampedObject} TimestampedObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampedObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampedObject message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampedObject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.verify(message.normalizedBoundingBox); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + if (message.landmarks != null && message.hasOwnProperty("landmarks")) { + if (!Array.isArray(message.landmarks)) + return "landmarks: array expected"; + for (var i = 0; i < message.landmarks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.verify(message.landmarks[i]); + if (error) + return "landmarks." + error; + } + } + return null; + }; + + /** + * Creates a TimestampedObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.TimestampedObject} TimestampedObject + */ + TimestampedObject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.TimestampedObject) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.TimestampedObject(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TimestampedObject.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TimestampedObject.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TimestampedObject.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TimestampedObject.attributes: object expected"); + message.attributes[i] = $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.fromObject(object.attributes[i]); + } + } + if (object.landmarks) { + if (!Array.isArray(object.landmarks)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TimestampedObject.landmarks: array expected"); + message.landmarks = []; + for (var i = 0; i < object.landmarks.length; ++i) { + if (typeof object.landmarks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TimestampedObject.landmarks: object expected"); + message.landmarks[i] = $root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.fromObject(object.landmarks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimestampedObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {google.cloud.videointelligence.v1p3beta1.TimestampedObject} message TimestampedObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampedObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.attributes = []; + object.landmarks = []; + } + if (options.defaults) { + object.normalizedBoundingBox = null; + object.timeOffset = null; + } + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.toObject(message.attributes[j], options); + } + if (message.landmarks && message.landmarks.length) { + object.landmarks = []; + for (var j = 0; j < message.landmarks.length; ++j) + object.landmarks[j] = $root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark.toObject(message.landmarks[j], options); + } + return object; + }; + + /** + * Converts this TimestampedObject to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @instance + * @returns {Object.} JSON object + */ + TimestampedObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampedObject + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.TimestampedObject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampedObject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.TimestampedObject"; + }; + + return TimestampedObject; + })(); + + v1p3beta1.Track = (function() { + + /** + * Properties of a Track. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ITrack + * @property {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null} [segment] Track segment + * @property {Array.|null} [timestampedObjects] Track timestampedObjects + * @property {Array.|null} [attributes] Track attributes + * @property {number|null} [confidence] Track confidence + */ + + /** + * Constructs a new Track. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a Track. + * @implements ITrack + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ITrack=} [properties] Properties to set + */ + function Track(properties) { + this.timestampedObjects = []; + this.attributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Track segment. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @instance + */ + Track.prototype.segment = null; + + /** + * Track timestampedObjects. + * @member {Array.} timestampedObjects + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @instance + */ + Track.prototype.timestampedObjects = $util.emptyArray; + + /** + * Track attributes. + * @member {Array.} attributes + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @instance + */ + Track.prototype.attributes = $util.emptyArray; + + /** + * Track confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @instance + */ + Track.prototype.confidence = 0; + + /** + * Creates a new Track instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITrack=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.Track} Track instance + */ + Track.create = function create(properties) { + return new Track(properties); + }; + + /** + * Encodes the specified Track message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Track.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITrack} message Track message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Track.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timestampedObjects != null && message.timestampedObjects.length) + for (var i = 0; i < message.timestampedObjects.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.TimestampedObject.encode(message.timestampedObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0; i < message.attributes.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.encode(message.attributes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified Track message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Track.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITrack} message Track message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Track.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Track message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.Track} Track + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Track.decode = function 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.videointelligence.v1p3beta1.Track(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.timestampedObjects && message.timestampedObjects.length)) + message.timestampedObjects = []; + message.timestampedObjects.push($root.google.cloud.videointelligence.v1p3beta1.TimestampedObject.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.decode(reader, reader.uint32())); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Track message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.Track} Track + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Track.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Track message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Track.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.timestampedObjects != null && message.hasOwnProperty("timestampedObjects")) { + if (!Array.isArray(message.timestampedObjects)) + return "timestampedObjects: array expected"; + for (var i = 0; i < message.timestampedObjects.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.TimestampedObject.verify(message.timestampedObjects[i]); + if (error) + return "timestampedObjects." + error; + } + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.verify(message.attributes[i]); + if (error) + return "attributes." + error; + } + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a Track message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.Track} Track + */ + Track.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.Track) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.Track(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.Track.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segment); + } + if (object.timestampedObjects) { + if (!Array.isArray(object.timestampedObjects)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.Track.timestampedObjects: array expected"); + message.timestampedObjects = []; + for (var i = 0; i < object.timestampedObjects.length; ++i) { + if (typeof object.timestampedObjects[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.Track.timestampedObjects: object expected"); + message.timestampedObjects[i] = $root.google.cloud.videointelligence.v1p3beta1.TimestampedObject.fromObject(object.timestampedObjects[i]); + } + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.Track.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.Track.attributes: object expected"); + message.attributes[i] = $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.fromObject(object.attributes[i]); + } + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a Track message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {google.cloud.videointelligence.v1p3beta1.Track} message Track + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Track.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.timestampedObjects = []; + object.attributes = []; + } + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segment, options); + if (message.timestampedObjects && message.timestampedObjects.length) { + object.timestampedObjects = []; + for (var j = 0; j < message.timestampedObjects.length; ++j) + object.timestampedObjects[j] = $root.google.cloud.videointelligence.v1p3beta1.TimestampedObject.toObject(message.timestampedObjects[j], options); + } + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) + object.attributes[j] = $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute.toObject(message.attributes[j], options); + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this Track to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @instance + * @returns {Object.} JSON object + */ + Track.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Track + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.Track + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Track.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.Track"; + }; + + return Track; + })(); + + v1p3beta1.DetectedAttribute = (function() { + + /** + * Properties of a DetectedAttribute. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IDetectedAttribute + * @property {string|null} [name] DetectedAttribute name + * @property {number|null} [confidence] DetectedAttribute confidence + * @property {string|null} [value] DetectedAttribute value + */ + + /** + * Constructs a new DetectedAttribute. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a DetectedAttribute. + * @implements IDetectedAttribute + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedAttribute=} [properties] Properties to set + */ + function DetectedAttribute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedAttribute name. + * @member {string} name + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @instance + */ + DetectedAttribute.prototype.name = ""; + + /** + * DetectedAttribute confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @instance + */ + DetectedAttribute.prototype.confidence = 0; + + /** + * DetectedAttribute value. + * @member {string} value + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @instance + */ + DetectedAttribute.prototype.value = ""; + + /** + * Creates a new DetectedAttribute instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedAttribute=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedAttribute} DetectedAttribute instance + */ + DetectedAttribute.create = function create(properties) { + return new DetectedAttribute(properties); + }; + + /** + * Encodes the specified DetectedAttribute message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedAttribute.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedAttribute} message DetectedAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedAttribute.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.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + return writer; + }; + + /** + * Encodes the specified DetectedAttribute message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedAttribute} message DetectedAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedAttribute} DetectedAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedAttribute.decode = function 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.videointelligence.v1p3beta1.DetectedAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedAttribute} DetectedAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedAttribute message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedAttribute.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.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a DetectedAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedAttribute} DetectedAttribute + */ + DetectedAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.DetectedAttribute(); + if (object.name != null) + message.name = String(object.name); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a DetectedAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {google.cloud.videointelligence.v1p3beta1.DetectedAttribute} message DetectedAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.confidence = 0; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this DetectedAttribute to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @instance + * @returns {Object.} JSON object + */ + DetectedAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedAttribute + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.DetectedAttribute"; + }; + + return DetectedAttribute; + })(); + + v1p3beta1.Celebrity = (function() { + + /** + * Properties of a Celebrity. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ICelebrity + * @property {string|null} [name] Celebrity name + * @property {string|null} [displayName] Celebrity displayName + * @property {string|null} [description] Celebrity description + */ + + /** + * Constructs a new Celebrity. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a Celebrity. + * @implements ICelebrity + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrity=} [properties] Properties to set + */ + function Celebrity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Celebrity name. + * @member {string} name + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @instance + */ + Celebrity.prototype.name = ""; + + /** + * Celebrity displayName. + * @member {string} displayName + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @instance + */ + Celebrity.prototype.displayName = ""; + + /** + * Celebrity description. + * @member {string} description + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @instance + */ + Celebrity.prototype.description = ""; + + /** + * Creates a new Celebrity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.Celebrity} Celebrity instance + */ + Celebrity.create = function create(properties) { + return new Celebrity(properties); + }; + + /** + * Encodes the specified Celebrity message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Celebrity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrity} message Celebrity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Celebrity.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified Celebrity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.Celebrity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrity} message Celebrity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Celebrity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Celebrity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.Celebrity} Celebrity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Celebrity.decode = function 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.videointelligence.v1p3beta1.Celebrity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Celebrity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.Celebrity} Celebrity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Celebrity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Celebrity message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Celebrity.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Celebrity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.Celebrity} Celebrity + */ + Celebrity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.Celebrity) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.Celebrity(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Celebrity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.Celebrity} message Celebrity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Celebrity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Celebrity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @instance + * @returns {Object.} JSON object + */ + Celebrity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Celebrity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.Celebrity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Celebrity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.Celebrity"; + }; + + return Celebrity; + })(); + + v1p3beta1.CelebrityTrack = (function() { + + /** + * Properties of a CelebrityTrack. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ICelebrityTrack + * @property {Array.|null} [celebrities] CelebrityTrack celebrities + * @property {google.cloud.videointelligence.v1p3beta1.ITrack|null} [faceTrack] CelebrityTrack faceTrack + */ + + /** + * Constructs a new CelebrityTrack. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a CelebrityTrack. + * @implements ICelebrityTrack + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityTrack=} [properties] Properties to set + */ + function CelebrityTrack(properties) { + this.celebrities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CelebrityTrack celebrities. + * @member {Array.} celebrities + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @instance + */ + CelebrityTrack.prototype.celebrities = $util.emptyArray; + + /** + * CelebrityTrack faceTrack. + * @member {google.cloud.videointelligence.v1p3beta1.ITrack|null|undefined} faceTrack + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @instance + */ + CelebrityTrack.prototype.faceTrack = null; + + /** + * Creates a new CelebrityTrack instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityTrack=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack} CelebrityTrack instance + */ + CelebrityTrack.create = function create(properties) { + return new CelebrityTrack(properties); + }; + + /** + * Encodes the specified CelebrityTrack message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityTrack} message CelebrityTrack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CelebrityTrack.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.celebrities != null && message.celebrities.length) + for (var i = 0; i < message.celebrities.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.encode(message.celebrities[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.faceTrack != null && Object.hasOwnProperty.call(message, "faceTrack")) + $root.google.cloud.videointelligence.v1p3beta1.Track.encode(message.faceTrack, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CelebrityTrack message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityTrack} message CelebrityTrack message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CelebrityTrack.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CelebrityTrack message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack} CelebrityTrack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CelebrityTrack.decode = function 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.videointelligence.v1p3beta1.CelebrityTrack(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.celebrities && message.celebrities.length)) + message.celebrities = []; + message.celebrities.push($root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.decode(reader, reader.uint32())); + break; + } + case 3: { + message.faceTrack = $root.google.cloud.videointelligence.v1p3beta1.Track.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CelebrityTrack message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack} CelebrityTrack + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CelebrityTrack.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CelebrityTrack message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CelebrityTrack.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.celebrities != null && message.hasOwnProperty("celebrities")) { + if (!Array.isArray(message.celebrities)) + return "celebrities: array expected"; + for (var i = 0; i < message.celebrities.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.verify(message.celebrities[i]); + if (error) + return "celebrities." + error; + } + } + if (message.faceTrack != null && message.hasOwnProperty("faceTrack")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Track.verify(message.faceTrack); + if (error) + return "faceTrack." + error; + } + return null; + }; + + /** + * Creates a CelebrityTrack message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack} CelebrityTrack + */ + CelebrityTrack.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack(); + if (object.celebrities) { + if (!Array.isArray(object.celebrities)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.CelebrityTrack.celebrities: array expected"); + message.celebrities = []; + for (var i = 0; i < object.celebrities.length; ++i) { + if (typeof object.celebrities[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.CelebrityTrack.celebrities: object expected"); + message.celebrities[i] = $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.fromObject(object.celebrities[i]); + } + } + if (object.faceTrack != null) { + if (typeof object.faceTrack !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.CelebrityTrack.faceTrack: object expected"); + message.faceTrack = $root.google.cloud.videointelligence.v1p3beta1.Track.fromObject(object.faceTrack); + } + return message; + }; + + /** + * Creates a plain object from a CelebrityTrack message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityTrack} message CelebrityTrack + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CelebrityTrack.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.celebrities = []; + if (options.defaults) + object.faceTrack = null; + if (message.celebrities && message.celebrities.length) { + object.celebrities = []; + for (var j = 0; j < message.celebrities.length; ++j) + object.celebrities[j] = $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.toObject(message.celebrities[j], options); + } + if (message.faceTrack != null && message.hasOwnProperty("faceTrack")) + object.faceTrack = $root.google.cloud.videointelligence.v1p3beta1.Track.toObject(message.faceTrack, options); + return object; + }; + + /** + * Converts this CelebrityTrack to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @instance + * @returns {Object.} JSON object + */ + CelebrityTrack.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CelebrityTrack + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CelebrityTrack.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.CelebrityTrack"; + }; + + CelebrityTrack.RecognizedCelebrity = (function() { + + /** + * Properties of a RecognizedCelebrity. + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @interface IRecognizedCelebrity + * @property {google.cloud.videointelligence.v1p3beta1.ICelebrity|null} [celebrity] RecognizedCelebrity celebrity + * @property {number|null} [confidence] RecognizedCelebrity confidence + */ + + /** + * Constructs a new RecognizedCelebrity. + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack + * @classdesc Represents a RecognizedCelebrity. + * @implements IRecognizedCelebrity + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity=} [properties] Properties to set + */ + function RecognizedCelebrity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecognizedCelebrity celebrity. + * @member {google.cloud.videointelligence.v1p3beta1.ICelebrity|null|undefined} celebrity + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @instance + */ + RecognizedCelebrity.prototype.celebrity = null; + + /** + * RecognizedCelebrity confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @instance + */ + RecognizedCelebrity.prototype.confidence = 0; + + /** + * Creates a new RecognizedCelebrity instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity} RecognizedCelebrity instance + */ + RecognizedCelebrity.create = function create(properties) { + return new RecognizedCelebrity(properties); + }; + + /** + * Encodes the specified RecognizedCelebrity message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity} message RecognizedCelebrity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizedCelebrity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.celebrity != null && Object.hasOwnProperty.call(message, "celebrity")) + $root.google.cloud.videointelligence.v1p3beta1.Celebrity.encode(message.celebrity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified RecognizedCelebrity message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.IRecognizedCelebrity} message RecognizedCelebrity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecognizedCelebrity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecognizedCelebrity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity} RecognizedCelebrity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizedCelebrity.decode = function 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.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.celebrity = $root.google.cloud.videointelligence.v1p3beta1.Celebrity.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecognizedCelebrity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity} RecognizedCelebrity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecognizedCelebrity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecognizedCelebrity message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecognizedCelebrity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.celebrity != null && message.hasOwnProperty("celebrity")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Celebrity.verify(message.celebrity); + if (error) + return "celebrity." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a RecognizedCelebrity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity} RecognizedCelebrity + */ + RecognizedCelebrity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity(); + if (object.celebrity != null) { + if (typeof object.celebrity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.celebrity: object expected"); + message.celebrity = $root.google.cloud.videointelligence.v1p3beta1.Celebrity.fromObject(object.celebrity); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a RecognizedCelebrity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity} message RecognizedCelebrity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecognizedCelebrity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.celebrity = null; + object.confidence = 0; + } + if (message.celebrity != null && message.hasOwnProperty("celebrity")) + object.celebrity = $root.google.cloud.videointelligence.v1p3beta1.Celebrity.toObject(message.celebrity, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this RecognizedCelebrity to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @instance + * @returns {Object.} JSON object + */ + RecognizedCelebrity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecognizedCelebrity + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecognizedCelebrity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity"; + }; + + return RecognizedCelebrity; + })(); + + return CelebrityTrack; + })(); + + v1p3beta1.CelebrityRecognitionAnnotation = (function() { + + /** + * Properties of a CelebrityRecognitionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ICelebrityRecognitionAnnotation + * @property {Array.|null} [celebrityTracks] CelebrityRecognitionAnnotation celebrityTracks + */ + + /** + * Constructs a new CelebrityRecognitionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a CelebrityRecognitionAnnotation. + * @implements ICelebrityRecognitionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation=} [properties] Properties to set + */ + function CelebrityRecognitionAnnotation(properties) { + this.celebrityTracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CelebrityRecognitionAnnotation celebrityTracks. + * @member {Array.} celebrityTracks + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @instance + */ + CelebrityRecognitionAnnotation.prototype.celebrityTracks = $util.emptyArray; + + /** + * Creates a new CelebrityRecognitionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation} CelebrityRecognitionAnnotation instance + */ + CelebrityRecognitionAnnotation.create = function create(properties) { + return new CelebrityRecognitionAnnotation(properties); + }; + + /** + * Encodes the specified CelebrityRecognitionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation} message CelebrityRecognitionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CelebrityRecognitionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.celebrityTracks != null && message.celebrityTracks.length) + for (var i = 0; i < message.celebrityTracks.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.encode(message.celebrityTracks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CelebrityRecognitionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation} message CelebrityRecognitionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CelebrityRecognitionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CelebrityRecognitionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation} CelebrityRecognitionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CelebrityRecognitionAnnotation.decode = function 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.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.celebrityTracks && message.celebrityTracks.length)) + message.celebrityTracks = []; + message.celebrityTracks.push($root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CelebrityRecognitionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation} CelebrityRecognitionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CelebrityRecognitionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CelebrityRecognitionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CelebrityRecognitionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.celebrityTracks != null && message.hasOwnProperty("celebrityTracks")) { + if (!Array.isArray(message.celebrityTracks)) + return "celebrityTracks: array expected"; + for (var i = 0; i < message.celebrityTracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.verify(message.celebrityTracks[i]); + if (error) + return "celebrityTracks." + error; + } + } + return null; + }; + + /** + * Creates a CelebrityRecognitionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation} CelebrityRecognitionAnnotation + */ + CelebrityRecognitionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation(); + if (object.celebrityTracks) { + if (!Array.isArray(object.celebrityTracks)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.celebrityTracks: array expected"); + message.celebrityTracks = []; + for (var i = 0; i < object.celebrityTracks.length; ++i) { + if (typeof object.celebrityTracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.celebrityTracks: object expected"); + message.celebrityTracks[i] = $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.fromObject(object.celebrityTracks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CelebrityRecognitionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation} message CelebrityRecognitionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CelebrityRecognitionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.celebrityTracks = []; + if (message.celebrityTracks && message.celebrityTracks.length) { + object.celebrityTracks = []; + for (var j = 0; j < message.celebrityTracks.length; ++j) + object.celebrityTracks[j] = $root.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.toObject(message.celebrityTracks[j], options); + } + return object; + }; + + /** + * Converts this CelebrityRecognitionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @instance + * @returns {Object.} JSON object + */ + CelebrityRecognitionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CelebrityRecognitionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CelebrityRecognitionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation"; + }; + + return CelebrityRecognitionAnnotation; + })(); + + v1p3beta1.DetectedLandmark = (function() { + + /** + * Properties of a DetectedLandmark. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IDetectedLandmark + * @property {string|null} [name] DetectedLandmark name + * @property {google.cloud.videointelligence.v1p3beta1.INormalizedVertex|null} [point] DetectedLandmark point + * @property {number|null} [confidence] DetectedLandmark confidence + */ + + /** + * Constructs a new DetectedLandmark. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a DetectedLandmark. + * @implements IDetectedLandmark + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedLandmark=} [properties] Properties to set + */ + function DetectedLandmark(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectedLandmark name. + * @member {string} name + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @instance + */ + DetectedLandmark.prototype.name = ""; + + /** + * DetectedLandmark point. + * @member {google.cloud.videointelligence.v1p3beta1.INormalizedVertex|null|undefined} point + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @instance + */ + DetectedLandmark.prototype.point = null; + + /** + * DetectedLandmark confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @instance + */ + DetectedLandmark.prototype.confidence = 0; + + /** + * Creates a new DetectedLandmark instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedLandmark=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedLandmark} DetectedLandmark instance + */ + DetectedLandmark.create = function create(properties) { + return new DetectedLandmark(properties); + }; + + /** + * Encodes the specified DetectedLandmark message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedLandmark.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedLandmark} message DetectedLandmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLandmark.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.point != null && Object.hasOwnProperty.call(message, "point")) + $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.encode(message.point, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedLandmark message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.DetectedLandmark.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IDetectedLandmark} message DetectedLandmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedLandmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedLandmark} DetectedLandmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLandmark.decode = function 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.videointelligence.v1p3beta1.DetectedLandmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.point = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.decode(reader, reader.uint32()); + break; + } + case 3: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedLandmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedLandmark} DetectedLandmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedLandmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedLandmark message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedLandmark.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.point != null && message.hasOwnProperty("point")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.verify(message.point); + if (error) + return "point." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedLandmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.DetectedLandmark} DetectedLandmark + */ + DetectedLandmark.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.DetectedLandmark(); + if (object.name != null) + message.name = String(object.name); + if (object.point != null) { + if (typeof object.point !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.DetectedLandmark.point: object expected"); + message.point = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.fromObject(object.point); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedLandmark message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {google.cloud.videointelligence.v1p3beta1.DetectedLandmark} message DetectedLandmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedLandmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.point = null; + object.confidence = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.point != null && message.hasOwnProperty("point")) + object.point = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.toObject(message.point, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedLandmark to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @instance + * @returns {Object.} JSON object + */ + DetectedLandmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedLandmark + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.DetectedLandmark + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedLandmark.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.DetectedLandmark"; + }; + + return DetectedLandmark; + })(); + + v1p3beta1.FaceDetectionAnnotation = (function() { + + /** + * Properties of a FaceDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IFaceDetectionAnnotation + * @property {Array.|null} [tracks] FaceDetectionAnnotation tracks + * @property {Uint8Array|null} [thumbnail] FaceDetectionAnnotation thumbnail + */ + + /** + * Constructs a new FaceDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a FaceDetectionAnnotation. + * @implements IFaceDetectionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation=} [properties] Properties to set + */ + function FaceDetectionAnnotation(properties) { + this.tracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaceDetectionAnnotation tracks. + * @member {Array.} tracks + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @instance + */ + FaceDetectionAnnotation.prototype.tracks = $util.emptyArray; + + /** + * FaceDetectionAnnotation thumbnail. + * @member {Uint8Array} thumbnail + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @instance + */ + FaceDetectionAnnotation.prototype.thumbnail = $util.newBuffer([]); + + /** + * Creates a new FaceDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation} FaceDetectionAnnotation instance + */ + FaceDetectionAnnotation.create = function create(properties) { + return new FaceDetectionAnnotation(properties); + }; + + /** + * Encodes the specified FaceDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation} message FaceDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tracks != null && message.tracks.length) + for (var i = 0; i < message.tracks.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.Track.encode(message.tracks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.thumbnail); + return writer; + }; + + /** + * Encodes the specified FaceDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IFaceDetectionAnnotation} message FaceDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaceDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation} FaceDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionAnnotation.decode = function 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.videointelligence.v1p3beta1.FaceDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.tracks && message.tracks.length)) + message.tracks = []; + message.tracks.push($root.google.cloud.videointelligence.v1p3beta1.Track.decode(reader, reader.uint32())); + break; + } + case 4: { + message.thumbnail = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaceDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation} FaceDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaceDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaceDetectionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaceDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tracks != null && message.hasOwnProperty("tracks")) { + if (!Array.isArray(message.tracks)) + return "tracks: array expected"; + for (var i = 0; i < message.tracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Track.verify(message.tracks[i]); + if (error) + return "tracks." + error; + } + } + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) + return "thumbnail: buffer expected"; + return null; + }; + + /** + * Creates a FaceDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation} FaceDetectionAnnotation + */ + FaceDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation(); + if (object.tracks) { + if (!Array.isArray(object.tracks)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.tracks: array expected"); + message.tracks = []; + for (var i = 0; i < object.tracks.length; ++i) { + if (typeof object.tracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.tracks: object expected"); + message.tracks[i] = $root.google.cloud.videointelligence.v1p3beta1.Track.fromObject(object.tracks[i]); + } + } + if (object.thumbnail != null) + if (typeof object.thumbnail === "string") + $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); + else if (object.thumbnail.length >= 0) + message.thumbnail = object.thumbnail; + return message; + }; + + /** + * Creates a plain object from a FaceDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation} message FaceDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaceDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tracks = []; + if (options.defaults) + if (options.bytes === String) + object.thumbnail = ""; + else { + object.thumbnail = []; + if (options.bytes !== Array) + object.thumbnail = $util.newBuffer(object.thumbnail); + } + if (message.tracks && message.tracks.length) { + object.tracks = []; + for (var j = 0; j < message.tracks.length; ++j) + object.tracks[j] = $root.google.cloud.videointelligence.v1p3beta1.Track.toObject(message.tracks[j], options); + } + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; + return object; + }; + + /** + * Converts this FaceDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + FaceDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaceDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaceDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation"; + }; + + return FaceDetectionAnnotation; + })(); + + v1p3beta1.PersonDetectionAnnotation = (function() { + + /** + * Properties of a PersonDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IPersonDetectionAnnotation + * @property {Array.|null} [tracks] PersonDetectionAnnotation tracks + */ + + /** + * Constructs a new PersonDetectionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a PersonDetectionAnnotation. + * @implements IPersonDetectionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation=} [properties] Properties to set + */ + function PersonDetectionAnnotation(properties) { + this.tracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonDetectionAnnotation tracks. + * @member {Array.} tracks + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @instance + */ + PersonDetectionAnnotation.prototype.tracks = $util.emptyArray; + + /** + * Creates a new PersonDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation} PersonDetectionAnnotation instance + */ + PersonDetectionAnnotation.create = function create(properties) { + return new PersonDetectionAnnotation(properties); + }; + + /** + * Encodes the specified PersonDetectionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation} message PersonDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tracks != null && message.tracks.length) + for (var i = 0; i < message.tracks.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.Track.encode(message.tracks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PersonDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IPersonDetectionAnnotation} message PersonDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation} PersonDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionAnnotation.decode = function 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.videointelligence.v1p3beta1.PersonDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tracks && message.tracks.length)) + message.tracks = []; + message.tracks.push($root.google.cloud.videointelligence.v1p3beta1.Track.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation} PersonDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonDetectionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tracks != null && message.hasOwnProperty("tracks")) { + if (!Array.isArray(message.tracks)) + return "tracks: array expected"; + for (var i = 0; i < message.tracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Track.verify(message.tracks[i]); + if (error) + return "tracks." + error; + } + } + return null; + }; + + /** + * Creates a PersonDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation} PersonDetectionAnnotation + */ + PersonDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation(); + if (object.tracks) { + if (!Array.isArray(object.tracks)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.tracks: array expected"); + message.tracks = []; + for (var i = 0; i < object.tracks.length; ++i) { + if (typeof object.tracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.tracks: object expected"); + message.tracks[i] = $root.google.cloud.videointelligence.v1p3beta1.Track.fromObject(object.tracks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PersonDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation} message PersonDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tracks = []; + if (message.tracks && message.tracks.length) { + object.tracks = []; + for (var j = 0; j < message.tracks.length; ++j) + object.tracks[j] = $root.google.cloud.videointelligence.v1p3beta1.Track.toObject(message.tracks[j], options); + } + return object; + }; + + /** + * Converts this PersonDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + PersonDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersonDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersonDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation"; + }; + + return PersonDetectionAnnotation; + })(); + + v1p3beta1.VideoAnnotationResults = (function() { + + /** + * Properties of a VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IVideoAnnotationResults + * @property {string|null} [inputUri] VideoAnnotationResults inputUri + * @property {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null} [segment] VideoAnnotationResults segment + * @property {Array.|null} [segmentLabelAnnotations] VideoAnnotationResults segmentLabelAnnotations + * @property {Array.|null} [segmentPresenceLabelAnnotations] VideoAnnotationResults segmentPresenceLabelAnnotations + * @property {Array.|null} [shotLabelAnnotations] VideoAnnotationResults shotLabelAnnotations + * @property {Array.|null} [shotPresenceLabelAnnotations] VideoAnnotationResults shotPresenceLabelAnnotations + * @property {Array.|null} [frameLabelAnnotations] VideoAnnotationResults frameLabelAnnotations + * @property {Array.|null} [faceDetectionAnnotations] VideoAnnotationResults faceDetectionAnnotations + * @property {Array.|null} [shotAnnotations] VideoAnnotationResults shotAnnotations + * @property {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null} [explicitAnnotation] VideoAnnotationResults explicitAnnotation + * @property {Array.|null} [speechTranscriptions] VideoAnnotationResults speechTranscriptions + * @property {Array.|null} [textAnnotations] VideoAnnotationResults textAnnotations + * @property {Array.|null} [objectAnnotations] VideoAnnotationResults objectAnnotations + * @property {Array.|null} [logoRecognitionAnnotations] VideoAnnotationResults logoRecognitionAnnotations + * @property {Array.|null} [personDetectionAnnotations] VideoAnnotationResults personDetectionAnnotations + * @property {google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation|null} [celebrityRecognitionAnnotations] VideoAnnotationResults celebrityRecognitionAnnotations + * @property {google.rpc.IStatus|null} [error] VideoAnnotationResults error + */ + + /** + * Constructs a new VideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a VideoAnnotationResults. + * @implements IVideoAnnotationResults + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults=} [properties] Properties to set + */ + function VideoAnnotationResults(properties) { + this.segmentLabelAnnotations = []; + this.segmentPresenceLabelAnnotations = []; + this.shotLabelAnnotations = []; + this.shotPresenceLabelAnnotations = []; + this.frameLabelAnnotations = []; + this.faceDetectionAnnotations = []; + this.shotAnnotations = []; + this.speechTranscriptions = []; + this.textAnnotations = []; + this.objectAnnotations = []; + this.logoRecognitionAnnotations = []; + this.personDetectionAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationResults inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.inputUri = ""; + + /** + * VideoAnnotationResults segment. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segment = null; + + /** + * VideoAnnotationResults segmentLabelAnnotations. + * @member {Array.} segmentLabelAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults segmentPresenceLabelAnnotations. + * @member {Array.} segmentPresenceLabelAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.segmentPresenceLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotLabelAnnotations. + * @member {Array.} shotLabelAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotPresenceLabelAnnotations. + * @member {Array.} shotPresenceLabelAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotPresenceLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults frameLabelAnnotations. + * @member {Array.} frameLabelAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.frameLabelAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults faceDetectionAnnotations. + * @member {Array.} faceDetectionAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.faceDetectionAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults shotAnnotations. + * @member {Array.} shotAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.shotAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults explicitAnnotation. + * @member {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null|undefined} explicitAnnotation + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.explicitAnnotation = null; + + /** + * VideoAnnotationResults speechTranscriptions. + * @member {Array.} speechTranscriptions + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.speechTranscriptions = $util.emptyArray; + + /** + * VideoAnnotationResults textAnnotations. + * @member {Array.} textAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.textAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults objectAnnotations. + * @member {Array.} objectAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.objectAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults logoRecognitionAnnotations. + * @member {Array.} logoRecognitionAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.logoRecognitionAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults personDetectionAnnotations. + * @member {Array.} personDetectionAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.personDetectionAnnotations = $util.emptyArray; + + /** + * VideoAnnotationResults celebrityRecognitionAnnotations. + * @member {google.cloud.videointelligence.v1p3beta1.ICelebrityRecognitionAnnotation|null|undefined} celebrityRecognitionAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.celebrityRecognitionAnnotations = null; + + /** + * VideoAnnotationResults error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + */ + VideoAnnotationResults.prototype.error = null; + + /** + * Creates a new VideoAnnotationResults instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults} VideoAnnotationResults instance + */ + VideoAnnotationResults.create = function create(properties) { + return new VideoAnnotationResults(properties); + }; + + /** + * Encodes the specified VideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.segmentLabelAnnotations != null && message.segmentLabelAnnotations.length) + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.encode(message.segmentLabelAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shotLabelAnnotations != null && message.shotLabelAnnotations.length) + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.encode(message.shotLabelAnnotations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.frameLabelAnnotations != null && message.frameLabelAnnotations.length) + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.encode(message.frameLabelAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.shotAnnotations != null && message.shotAnnotations.length) + for (var i = 0; i < message.shotAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.shotAnnotations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.explicitAnnotation != null && Object.hasOwnProperty.call(message, "explicitAnnotation")) + $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.encode(message.explicitAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.speechTranscriptions != null && message.speechTranscriptions.length) + for (var i = 0; i < message.speechTranscriptions.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription.encode(message.speechTranscriptions[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.textAnnotations != null && message.textAnnotations.length) + for (var i = 0; i < message.textAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.TextAnnotation.encode(message.textAnnotations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.faceDetectionAnnotations != null && message.faceDetectionAnnotations.length) + for (var i = 0; i < message.faceDetectionAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.encode(message.faceDetectionAnnotations[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.objectAnnotations != null && message.objectAnnotations.length) + for (var i = 0; i < message.objectAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.encode(message.objectAnnotations[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.logoRecognitionAnnotations != null && message.logoRecognitionAnnotations.length) + for (var i = 0; i < message.logoRecognitionAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.encode(message.logoRecognitionAnnotations[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.personDetectionAnnotations != null && message.personDetectionAnnotations.length) + for (var i = 0; i < message.personDetectionAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.encode(message.personDetectionAnnotations[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.celebrityRecognitionAnnotations != null && Object.hasOwnProperty.call(message, "celebrityRecognitionAnnotations")) + $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.encode(message.celebrityRecognitionAnnotations, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.segmentPresenceLabelAnnotations != null && message.segmentPresenceLabelAnnotations.length) + for (var i = 0; i < message.segmentPresenceLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.encode(message.segmentPresenceLabelAnnotations[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.shotPresenceLabelAnnotations != null && message.shotPresenceLabelAnnotations.length) + for (var i = 0; i < message.shotPresenceLabelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.encode(message.shotPresenceLabelAnnotations[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationResults} message VideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decode = function 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.videointelligence.v1p3beta1.VideoAnnotationResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 10: { + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.segmentLabelAnnotations && message.segmentLabelAnnotations.length)) + message.segmentLabelAnnotations = []; + message.segmentLabelAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 23: { + if (!(message.segmentPresenceLabelAnnotations && message.segmentPresenceLabelAnnotations.length)) + message.segmentPresenceLabelAnnotations = []; + message.segmentPresenceLabelAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.shotLabelAnnotations && message.shotLabelAnnotations.length)) + message.shotLabelAnnotations = []; + message.shotLabelAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 24: { + if (!(message.shotPresenceLabelAnnotations && message.shotPresenceLabelAnnotations.length)) + message.shotPresenceLabelAnnotations = []; + message.shotPresenceLabelAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.frameLabelAnnotations && message.frameLabelAnnotations.length)) + message.frameLabelAnnotations = []; + message.frameLabelAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.faceDetectionAnnotations && message.faceDetectionAnnotations.length)) + message.faceDetectionAnnotations = []; + message.faceDetectionAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.shotAnnotations && message.shotAnnotations.length)) + message.shotAnnotations = []; + message.shotAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.speechTranscriptions && message.speechTranscriptions.length)) + message.speechTranscriptions = []; + message.speechTranscriptions.push($root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.textAnnotations && message.textAnnotations.length)) + message.textAnnotations = []; + message.textAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.TextAnnotation.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.objectAnnotations && message.objectAnnotations.length)) + message.objectAnnotations = []; + message.objectAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.decode(reader, reader.uint32())); + break; + } + case 19: { + if (!(message.logoRecognitionAnnotations && message.logoRecognitionAnnotations.length)) + message.logoRecognitionAnnotations = []; + message.logoRecognitionAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.personDetectionAnnotations && message.personDetectionAnnotations.length)) + message.personDetectionAnnotations = []; + message.personDetectionAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.decode(reader, reader.uint32())); + break; + } + case 21: { + message.celebrityRecognitionAnnotations = $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.decode(reader, reader.uint32()); + break; + } + case 9: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults} VideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationResults message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.segmentLabelAnnotations != null && message.hasOwnProperty("segmentLabelAnnotations")) { + if (!Array.isArray(message.segmentLabelAnnotations)) + return "segmentLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify(message.segmentLabelAnnotations[i]); + if (error) + return "segmentLabelAnnotations." + error; + } + } + if (message.segmentPresenceLabelAnnotations != null && message.hasOwnProperty("segmentPresenceLabelAnnotations")) { + if (!Array.isArray(message.segmentPresenceLabelAnnotations)) + return "segmentPresenceLabelAnnotations: array expected"; + for (var i = 0; i < message.segmentPresenceLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify(message.segmentPresenceLabelAnnotations[i]); + if (error) + return "segmentPresenceLabelAnnotations." + error; + } + } + if (message.shotLabelAnnotations != null && message.hasOwnProperty("shotLabelAnnotations")) { + if (!Array.isArray(message.shotLabelAnnotations)) + return "shotLabelAnnotations: array expected"; + for (var i = 0; i < message.shotLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify(message.shotLabelAnnotations[i]); + if (error) + return "shotLabelAnnotations." + error; + } + } + if (message.shotPresenceLabelAnnotations != null && message.hasOwnProperty("shotPresenceLabelAnnotations")) { + if (!Array.isArray(message.shotPresenceLabelAnnotations)) + return "shotPresenceLabelAnnotations: array expected"; + for (var i = 0; i < message.shotPresenceLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify(message.shotPresenceLabelAnnotations[i]); + if (error) + return "shotPresenceLabelAnnotations." + error; + } + } + if (message.frameLabelAnnotations != null && message.hasOwnProperty("frameLabelAnnotations")) { + if (!Array.isArray(message.frameLabelAnnotations)) + return "frameLabelAnnotations: array expected"; + for (var i = 0; i < message.frameLabelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify(message.frameLabelAnnotations[i]); + if (error) + return "frameLabelAnnotations." + error; + } + } + if (message.faceDetectionAnnotations != null && message.hasOwnProperty("faceDetectionAnnotations")) { + if (!Array.isArray(message.faceDetectionAnnotations)) + return "faceDetectionAnnotations: array expected"; + for (var i = 0; i < message.faceDetectionAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.verify(message.faceDetectionAnnotations[i]); + if (error) + return "faceDetectionAnnotations." + error; + } + } + if (message.shotAnnotations != null && message.hasOwnProperty("shotAnnotations")) { + if (!Array.isArray(message.shotAnnotations)) + return "shotAnnotations: array expected"; + for (var i = 0; i < message.shotAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.shotAnnotations[i]); + if (error) + return "shotAnnotations." + error; + } + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.verify(message.explicitAnnotation); + if (error) + return "explicitAnnotation." + error; + } + if (message.speechTranscriptions != null && message.hasOwnProperty("speechTranscriptions")) { + if (!Array.isArray(message.speechTranscriptions)) + return "speechTranscriptions: array expected"; + for (var i = 0; i < message.speechTranscriptions.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription.verify(message.speechTranscriptions[i]); + if (error) + return "speechTranscriptions." + error; + } + } + if (message.textAnnotations != null && message.hasOwnProperty("textAnnotations")) { + if (!Array.isArray(message.textAnnotations)) + return "textAnnotations: array expected"; + for (var i = 0; i < message.textAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.TextAnnotation.verify(message.textAnnotations[i]); + if (error) + return "textAnnotations." + error; + } + } + if (message.objectAnnotations != null && message.hasOwnProperty("objectAnnotations")) { + if (!Array.isArray(message.objectAnnotations)) + return "objectAnnotations: array expected"; + for (var i = 0; i < message.objectAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.verify(message.objectAnnotations[i]); + if (error) + return "objectAnnotations." + error; + } + } + if (message.logoRecognitionAnnotations != null && message.hasOwnProperty("logoRecognitionAnnotations")) { + if (!Array.isArray(message.logoRecognitionAnnotations)) + return "logoRecognitionAnnotations: array expected"; + for (var i = 0; i < message.logoRecognitionAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.verify(message.logoRecognitionAnnotations[i]); + if (error) + return "logoRecognitionAnnotations." + error; + } + } + if (message.personDetectionAnnotations != null && message.hasOwnProperty("personDetectionAnnotations")) { + if (!Array.isArray(message.personDetectionAnnotations)) + return "personDetectionAnnotations: array expected"; + for (var i = 0; i < message.personDetectionAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.verify(message.personDetectionAnnotations[i]); + if (error) + return "personDetectionAnnotations." + error; + } + } + if (message.celebrityRecognitionAnnotations != null && message.hasOwnProperty("celebrityRecognitionAnnotations")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.verify(message.celebrityRecognitionAnnotations); + if (error) + return "celebrityRecognitionAnnotations." + error; + } + 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 VideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults} VideoAnnotationResults + */ + VideoAnnotationResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segment); + } + if (object.segmentLabelAnnotations) { + if (!Array.isArray(object.segmentLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segmentLabelAnnotations: array expected"); + message.segmentLabelAnnotations = []; + for (var i = 0; i < object.segmentLabelAnnotations.length; ++i) { + if (typeof object.segmentLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segmentLabelAnnotations: object expected"); + message.segmentLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.fromObject(object.segmentLabelAnnotations[i]); + } + } + if (object.segmentPresenceLabelAnnotations) { + if (!Array.isArray(object.segmentPresenceLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segmentPresenceLabelAnnotations: array expected"); + message.segmentPresenceLabelAnnotations = []; + for (var i = 0; i < object.segmentPresenceLabelAnnotations.length; ++i) { + if (typeof object.segmentPresenceLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segmentPresenceLabelAnnotations: object expected"); + message.segmentPresenceLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.fromObject(object.segmentPresenceLabelAnnotations[i]); + } + } + if (object.shotLabelAnnotations) { + if (!Array.isArray(object.shotLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shotLabelAnnotations: array expected"); + message.shotLabelAnnotations = []; + for (var i = 0; i < object.shotLabelAnnotations.length; ++i) { + if (typeof object.shotLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shotLabelAnnotations: object expected"); + message.shotLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.fromObject(object.shotLabelAnnotations[i]); + } + } + if (object.shotPresenceLabelAnnotations) { + if (!Array.isArray(object.shotPresenceLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shotPresenceLabelAnnotations: array expected"); + message.shotPresenceLabelAnnotations = []; + for (var i = 0; i < object.shotPresenceLabelAnnotations.length; ++i) { + if (typeof object.shotPresenceLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shotPresenceLabelAnnotations: object expected"); + message.shotPresenceLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.fromObject(object.shotPresenceLabelAnnotations[i]); + } + } + if (object.frameLabelAnnotations) { + if (!Array.isArray(object.frameLabelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.frameLabelAnnotations: array expected"); + message.frameLabelAnnotations = []; + for (var i = 0; i < object.frameLabelAnnotations.length; ++i) { + if (typeof object.frameLabelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.frameLabelAnnotations: object expected"); + message.frameLabelAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.fromObject(object.frameLabelAnnotations[i]); + } + } + if (object.faceDetectionAnnotations) { + if (!Array.isArray(object.faceDetectionAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.faceDetectionAnnotations: array expected"); + message.faceDetectionAnnotations = []; + for (var i = 0; i < object.faceDetectionAnnotations.length; ++i) { + if (typeof object.faceDetectionAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.faceDetectionAnnotations: object expected"); + message.faceDetectionAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.fromObject(object.faceDetectionAnnotations[i]); + } + } + if (object.shotAnnotations) { + if (!Array.isArray(object.shotAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shotAnnotations: array expected"); + message.shotAnnotations = []; + for (var i = 0; i < object.shotAnnotations.length; ++i) { + if (typeof object.shotAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shotAnnotations: object expected"); + message.shotAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.shotAnnotations[i]); + } + } + if (object.explicitAnnotation != null) { + if (typeof object.explicitAnnotation !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.explicitAnnotation: object expected"); + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.fromObject(object.explicitAnnotation); + } + if (object.speechTranscriptions) { + if (!Array.isArray(object.speechTranscriptions)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.speechTranscriptions: array expected"); + message.speechTranscriptions = []; + for (var i = 0; i < object.speechTranscriptions.length; ++i) { + if (typeof object.speechTranscriptions[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.speechTranscriptions: object expected"); + message.speechTranscriptions[i] = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription.fromObject(object.speechTranscriptions[i]); + } + } + if (object.textAnnotations) { + if (!Array.isArray(object.textAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.textAnnotations: array expected"); + message.textAnnotations = []; + for (var i = 0; i < object.textAnnotations.length; ++i) { + if (typeof object.textAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.textAnnotations: object expected"); + message.textAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.TextAnnotation.fromObject(object.textAnnotations[i]); + } + } + if (object.objectAnnotations) { + if (!Array.isArray(object.objectAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.objectAnnotations: array expected"); + message.objectAnnotations = []; + for (var i = 0; i < object.objectAnnotations.length; ++i) { + if (typeof object.objectAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.objectAnnotations: object expected"); + message.objectAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.fromObject(object.objectAnnotations[i]); + } + } + if (object.logoRecognitionAnnotations) { + if (!Array.isArray(object.logoRecognitionAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.logoRecognitionAnnotations: array expected"); + message.logoRecognitionAnnotations = []; + for (var i = 0; i < object.logoRecognitionAnnotations.length; ++i) { + if (typeof object.logoRecognitionAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.logoRecognitionAnnotations: object expected"); + message.logoRecognitionAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.fromObject(object.logoRecognitionAnnotations[i]); + } + } + if (object.personDetectionAnnotations) { + if (!Array.isArray(object.personDetectionAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.personDetectionAnnotations: array expected"); + message.personDetectionAnnotations = []; + for (var i = 0; i < object.personDetectionAnnotations.length; ++i) { + if (typeof object.personDetectionAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.personDetectionAnnotations: object expected"); + message.personDetectionAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.fromObject(object.personDetectionAnnotations[i]); + } + } + if (object.celebrityRecognitionAnnotations != null) { + if (typeof object.celebrityRecognitionAnnotations !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.celebrityRecognitionAnnotations: object expected"); + message.celebrityRecognitionAnnotations = $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.fromObject(object.celebrityRecognitionAnnotations); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults} message VideoAnnotationResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.segmentLabelAnnotations = []; + object.shotLabelAnnotations = []; + object.frameLabelAnnotations = []; + object.shotAnnotations = []; + object.speechTranscriptions = []; + object.textAnnotations = []; + object.faceDetectionAnnotations = []; + object.objectAnnotations = []; + object.logoRecognitionAnnotations = []; + object.personDetectionAnnotations = []; + object.segmentPresenceLabelAnnotations = []; + object.shotPresenceLabelAnnotations = []; + } + if (options.defaults) { + object.inputUri = ""; + object.explicitAnnotation = null; + object.error = null; + object.segment = null; + object.celebrityRecognitionAnnotations = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.segmentLabelAnnotations && message.segmentLabelAnnotations.length) { + object.segmentLabelAnnotations = []; + for (var j = 0; j < message.segmentLabelAnnotations.length; ++j) + object.segmentLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.toObject(message.segmentLabelAnnotations[j], options); + } + if (message.shotLabelAnnotations && message.shotLabelAnnotations.length) { + object.shotLabelAnnotations = []; + for (var j = 0; j < message.shotLabelAnnotations.length; ++j) + object.shotLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.toObject(message.shotLabelAnnotations[j], options); + } + if (message.frameLabelAnnotations && message.frameLabelAnnotations.length) { + object.frameLabelAnnotations = []; + for (var j = 0; j < message.frameLabelAnnotations.length; ++j) + object.frameLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.toObject(message.frameLabelAnnotations[j], options); + } + if (message.shotAnnotations && message.shotAnnotations.length) { + object.shotAnnotations = []; + for (var j = 0; j < message.shotAnnotations.length; ++j) + object.shotAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.shotAnnotations[j], options); + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) + object.explicitAnnotation = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.toObject(message.explicitAnnotation, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segment, options); + if (message.speechTranscriptions && message.speechTranscriptions.length) { + object.speechTranscriptions = []; + for (var j = 0; j < message.speechTranscriptions.length; ++j) + object.speechTranscriptions[j] = $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription.toObject(message.speechTranscriptions[j], options); + } + if (message.textAnnotations && message.textAnnotations.length) { + object.textAnnotations = []; + for (var j = 0; j < message.textAnnotations.length; ++j) + object.textAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.TextAnnotation.toObject(message.textAnnotations[j], options); + } + if (message.faceDetectionAnnotations && message.faceDetectionAnnotations.length) { + object.faceDetectionAnnotations = []; + for (var j = 0; j < message.faceDetectionAnnotations.length; ++j) + object.faceDetectionAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.FaceDetectionAnnotation.toObject(message.faceDetectionAnnotations[j], options); + } + if (message.objectAnnotations && message.objectAnnotations.length) { + object.objectAnnotations = []; + for (var j = 0; j < message.objectAnnotations.length; ++j) + object.objectAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.toObject(message.objectAnnotations[j], options); + } + if (message.logoRecognitionAnnotations && message.logoRecognitionAnnotations.length) { + object.logoRecognitionAnnotations = []; + for (var j = 0; j < message.logoRecognitionAnnotations.length; ++j) + object.logoRecognitionAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.toObject(message.logoRecognitionAnnotations[j], options); + } + if (message.personDetectionAnnotations && message.personDetectionAnnotations.length) { + object.personDetectionAnnotations = []; + for (var j = 0; j < message.personDetectionAnnotations.length; ++j) + object.personDetectionAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.PersonDetectionAnnotation.toObject(message.personDetectionAnnotations[j], options); + } + if (message.celebrityRecognitionAnnotations != null && message.hasOwnProperty("celebrityRecognitionAnnotations")) + object.celebrityRecognitionAnnotations = $root.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.toObject(message.celebrityRecognitionAnnotations, options); + if (message.segmentPresenceLabelAnnotations && message.segmentPresenceLabelAnnotations.length) { + object.segmentPresenceLabelAnnotations = []; + for (var j = 0; j < message.segmentPresenceLabelAnnotations.length; ++j) + object.segmentPresenceLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.toObject(message.segmentPresenceLabelAnnotations[j], options); + } + if (message.shotPresenceLabelAnnotations && message.shotPresenceLabelAnnotations.length) { + object.shotPresenceLabelAnnotations = []; + for (var j = 0; j < message.shotPresenceLabelAnnotations.length; ++j) + object.shotPresenceLabelAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.toObject(message.shotPresenceLabelAnnotations[j], options); + } + return object; + }; + + /** + * Converts this VideoAnnotationResults to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationResults + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults"; + }; + + return VideoAnnotationResults; + })(); + + v1p3beta1.AnnotateVideoResponse = (function() { + + /** + * Properties of an AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IAnnotateVideoResponse + * @property {Array.|null} [annotationResults] AnnotateVideoResponse annotationResults + */ + + /** + * Constructs a new AnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an AnnotateVideoResponse. + * @implements IAnnotateVideoResponse + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse=} [properties] Properties to set + */ + function AnnotateVideoResponse(properties) { + this.annotationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoResponse annotationResults. + * @member {Array.} annotationResults + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @instance + */ + AnnotateVideoResponse.prototype.annotationResults = $util.emptyArray; + + /** + * Creates a new AnnotateVideoResponse instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse} AnnotateVideoResponse instance + */ + AnnotateVideoResponse.create = function create(properties) { + return new AnnotateVideoResponse(properties); + }; + + /** + * Encodes the specified AnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationResults != null && message.annotationResults.length) + for (var i = 0; i < message.annotationResults.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.encode(message.annotationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse} message AnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decode = function 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.videointelligence.v1p3beta1.AnnotateVideoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationResults && message.annotationResults.length)) + message.annotationResults = []; + message.annotationResults.push($root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse} AnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoResponse message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) { + if (!Array.isArray(message.annotationResults)) + return "annotationResults: array expected"; + for (var i = 0; i < message.annotationResults.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.verify(message.annotationResults[i]); + if (error) + return "annotationResults." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse} AnnotateVideoResponse + */ + AnnotateVideoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse(); + if (object.annotationResults) { + if (!Array.isArray(object.annotationResults)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.annotationResults: array expected"); + message.annotationResults = []; + for (var i = 0; i < object.annotationResults.length; ++i) { + if (typeof object.annotationResults[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.annotationResults: object expected"); + message.annotationResults[i] = $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.fromObject(object.annotationResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse} message AnnotateVideoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationResults = []; + if (message.annotationResults && message.annotationResults.length) { + object.annotationResults = []; + for (var j = 0; j < message.annotationResults.length; ++j) + object.annotationResults[j] = $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.toObject(message.annotationResults[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoResponse to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoResponse + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse"; + }; + + return AnnotateVideoResponse; + })(); + + v1p3beta1.VideoAnnotationProgress = (function() { + + /** + * Properties of a VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IVideoAnnotationProgress + * @property {string|null} [inputUri] VideoAnnotationProgress inputUri + * @property {number|null} [progressPercent] VideoAnnotationProgress progressPercent + * @property {google.protobuf.ITimestamp|null} [startTime] VideoAnnotationProgress startTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VideoAnnotationProgress updateTime + * @property {google.cloud.videointelligence.v1p3beta1.Feature|null} [feature] VideoAnnotationProgress feature + * @property {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null} [segment] VideoAnnotationProgress segment + */ + + /** + * Constructs a new VideoAnnotationProgress. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a VideoAnnotationProgress. + * @implements IVideoAnnotationProgress + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress=} [properties] Properties to set + */ + function VideoAnnotationProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoAnnotationProgress inputUri. + * @member {string} inputUri + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.inputUri = ""; + + /** + * VideoAnnotationProgress progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.progressPercent = 0; + + /** + * VideoAnnotationProgress startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.startTime = null; + + /** + * VideoAnnotationProgress updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.updateTime = null; + + /** + * VideoAnnotationProgress feature. + * @member {google.cloud.videointelligence.v1p3beta1.Feature} feature + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.feature = 0; + + /** + * VideoAnnotationProgress segment. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + */ + VideoAnnotationProgress.prototype.segment = null; + + /** + * Creates a new VideoAnnotationProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress} VideoAnnotationProgress instance + */ + VideoAnnotationProgress.create = function create(properties) { + return new VideoAnnotationProgress(properties); + }; + + /** + * Encodes the specified VideoAnnotationProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.progressPercent); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.feature); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoAnnotationProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IVideoAnnotationProgress} message VideoAnnotationProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoAnnotationProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decode = function 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.videointelligence.v1p3beta1.VideoAnnotationProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + case 2: { + message.progressPercent = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.feature = reader.int32(); + break; + } + case 6: { + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoAnnotationProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress} VideoAnnotationProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoAnnotationProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoAnnotationProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoAnnotationProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.feature != null && message.hasOwnProperty("feature")) + switch (message.feature) { + default: + return "feature: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 9: + case 12: + case 13: + case 14: + break; + } + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + return null; + }; + + /** + * Creates a VideoAnnotationProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress} VideoAnnotationProgress + */ + VideoAnnotationProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.feature) { + default: + if (typeof object.feature === "number") { + message.feature = object.feature; + break; + } + break; + case "FEATURE_UNSPECIFIED": + case 0: + message.feature = 0; + break; + case "LABEL_DETECTION": + case 1: + message.feature = 1; + break; + case "SHOT_CHANGE_DETECTION": + case 2: + message.feature = 2; + break; + case "EXPLICIT_CONTENT_DETECTION": + case 3: + message.feature = 3; + break; + case "FACE_DETECTION": + case 4: + message.feature = 4; + break; + case "SPEECH_TRANSCRIPTION": + case 6: + message.feature = 6; + break; + case "TEXT_DETECTION": + case 7: + message.feature = 7; + break; + case "OBJECT_TRACKING": + case 9: + message.feature = 9; + break; + case "LOGO_RECOGNITION": + case 12: + message.feature = 12; + break; + case "CELEBRITY_RECOGNITION": + case 13: + message.feature = 13; + break; + case "PERSON_DETECTION": + case 14: + message.feature = 14; + break; + } + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segment); + } + return message; + }; + + /** + * Creates a plain object from a VideoAnnotationProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress} message VideoAnnotationProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoAnnotationProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputUri = ""; + object.progressPercent = 0; + object.startTime = null; + object.updateTime = null; + object.feature = options.enums === String ? "FEATURE_UNSPECIFIED" : 0; + object.segment = null; + } + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = options.enums === String ? $root.google.cloud.videointelligence.v1p3beta1.Feature[message.feature] === undefined ? message.feature : $root.google.cloud.videointelligence.v1p3beta1.Feature[message.feature] : message.feature; + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segment, options); + return object; + }; + + /** + * Converts this VideoAnnotationProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @instance + * @returns {Object.} JSON object + */ + VideoAnnotationProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoAnnotationProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoAnnotationProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress"; + }; + + return VideoAnnotationProgress; + })(); + + v1p3beta1.AnnotateVideoProgress = (function() { + + /** + * Properties of an AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IAnnotateVideoProgress + * @property {Array.|null} [annotationProgress] AnnotateVideoProgress annotationProgress + */ + + /** + * Constructs a new AnnotateVideoProgress. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an AnnotateVideoProgress. + * @implements IAnnotateVideoProgress + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress=} [properties] Properties to set + */ + function AnnotateVideoProgress(properties) { + this.annotationProgress = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotateVideoProgress annotationProgress. + * @member {Array.} annotationProgress + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @instance + */ + AnnotateVideoProgress.prototype.annotationProgress = $util.emptyArray; + + /** + * Creates a new AnnotateVideoProgress instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress} AnnotateVideoProgress instance + */ + AnnotateVideoProgress.create = function create(properties) { + return new AnnotateVideoProgress(properties); + }; + + /** + * Encodes the specified AnnotateVideoProgress message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationProgress != null && message.annotationProgress.length) + for (var i = 0; i < message.annotationProgress.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.encode(message.annotationProgress[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotateVideoProgress message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress} message AnnotateVideoProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotateVideoProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decode = function 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.videointelligence.v1p3beta1.AnnotateVideoProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationProgress && message.annotationProgress.length)) + message.annotationProgress = []; + message.annotationProgress.push($root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotateVideoProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress} AnnotateVideoProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotateVideoProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotateVideoProgress message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotateVideoProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationProgress != null && message.hasOwnProperty("annotationProgress")) { + if (!Array.isArray(message.annotationProgress)) + return "annotationProgress: array expected"; + for (var i = 0; i < message.annotationProgress.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.verify(message.annotationProgress[i]); + if (error) + return "annotationProgress." + error; + } + } + return null; + }; + + /** + * Creates an AnnotateVideoProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress} AnnotateVideoProgress + */ + AnnotateVideoProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress(); + if (object.annotationProgress) { + if (!Array.isArray(object.annotationProgress)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.annotationProgress: array expected"); + message.annotationProgress = []; + for (var i = 0; i < object.annotationProgress.length; ++i) { + if (typeof object.annotationProgress[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.annotationProgress: object expected"); + message.annotationProgress[i] = $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.fromObject(object.annotationProgress[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnnotateVideoProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress} message AnnotateVideoProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotateVideoProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationProgress = []; + if (message.annotationProgress && message.annotationProgress.length) { + object.annotationProgress = []; + for (var j = 0; j < message.annotationProgress.length; ++j) + object.annotationProgress[j] = $root.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.toObject(message.annotationProgress[j], options); + } + return object; + }; + + /** + * Converts this AnnotateVideoProgress to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @instance + * @returns {Object.} JSON object + */ + AnnotateVideoProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotateVideoProgress + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotateVideoProgress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress"; + }; + + return AnnotateVideoProgress; + })(); + + v1p3beta1.SpeechTranscriptionConfig = (function() { + + /** + * Properties of a SpeechTranscriptionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ISpeechTranscriptionConfig + * @property {string|null} [languageCode] SpeechTranscriptionConfig languageCode + * @property {number|null} [maxAlternatives] SpeechTranscriptionConfig maxAlternatives + * @property {boolean|null} [filterProfanity] SpeechTranscriptionConfig filterProfanity + * @property {Array.|null} [speechContexts] SpeechTranscriptionConfig speechContexts + * @property {boolean|null} [enableAutomaticPunctuation] SpeechTranscriptionConfig enableAutomaticPunctuation + * @property {Array.|null} [audioTracks] SpeechTranscriptionConfig audioTracks + * @property {boolean|null} [enableSpeakerDiarization] SpeechTranscriptionConfig enableSpeakerDiarization + * @property {number|null} [diarizationSpeakerCount] SpeechTranscriptionConfig diarizationSpeakerCount + * @property {boolean|null} [enableWordConfidence] SpeechTranscriptionConfig enableWordConfidence + */ + + /** + * Constructs a new SpeechTranscriptionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a SpeechTranscriptionConfig. + * @implements ISpeechTranscriptionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig=} [properties] Properties to set + */ + function SpeechTranscriptionConfig(properties) { + this.speechContexts = []; + this.audioTracks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechTranscriptionConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.languageCode = ""; + + /** + * SpeechTranscriptionConfig maxAlternatives. + * @member {number} maxAlternatives + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.maxAlternatives = 0; + + /** + * SpeechTranscriptionConfig filterProfanity. + * @member {boolean} filterProfanity + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.filterProfanity = false; + + /** + * SpeechTranscriptionConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.speechContexts = $util.emptyArray; + + /** + * SpeechTranscriptionConfig enableAutomaticPunctuation. + * @member {boolean} enableAutomaticPunctuation + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableAutomaticPunctuation = false; + + /** + * SpeechTranscriptionConfig audioTracks. + * @member {Array.} audioTracks + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.audioTracks = $util.emptyArray; + + /** + * SpeechTranscriptionConfig enableSpeakerDiarization. + * @member {boolean} enableSpeakerDiarization + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableSpeakerDiarization = false; + + /** + * SpeechTranscriptionConfig diarizationSpeakerCount. + * @member {number} diarizationSpeakerCount + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.diarizationSpeakerCount = 0; + + /** + * SpeechTranscriptionConfig enableWordConfidence. + * @member {boolean} enableWordConfidence + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + */ + SpeechTranscriptionConfig.prototype.enableWordConfidence = false; + + /** + * Creates a new SpeechTranscriptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig instance + */ + SpeechTranscriptionConfig.create = function create(properties) { + return new SpeechTranscriptionConfig(properties); + }; + + /** + * Encodes the specified SpeechTranscriptionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig} message SpeechTranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscriptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxAlternatives); + if (message.filterProfanity != null && Object.hasOwnProperty.call(message, "filterProfanity")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.filterProfanity); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableAutomaticPunctuation); + if (message.audioTracks != null && message.audioTracks.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.audioTracks.length; ++i) + writer.int32(message.audioTracks[i]); + writer.ldelim(); + } + if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableSpeakerDiarization); + if (message.diarizationSpeakerCount != null && Object.hasOwnProperty.call(message, "diarizationSpeakerCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.diarizationSpeakerCount); + if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableWordConfidence); + return writer; + }; + + /** + * Encodes the specified SpeechTranscriptionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscriptionConfig} message SpeechTranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscriptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscriptionConfig.decode = function 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.videointelligence.v1p3beta1.SpeechTranscriptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.languageCode = reader.string(); + break; + } + case 2: { + message.maxAlternatives = reader.int32(); + break; + } + case 3: { + message.filterProfanity = reader.bool(); + break; + } + case 4: { + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.videointelligence.v1p3beta1.SpeechContext.decode(reader, reader.uint32())); + break; + } + case 5: { + message.enableAutomaticPunctuation = reader.bool(); + break; + } + case 6: { + if (!(message.audioTracks && message.audioTracks.length)) + message.audioTracks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.audioTracks.push(reader.int32()); + } else + message.audioTracks.push(reader.int32()); + break; + } + case 7: { + message.enableSpeakerDiarization = reader.bool(); + break; + } + case 8: { + message.diarizationSpeakerCount = reader.int32(); + break; + } + case 9: { + message.enableWordConfidence = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechTranscriptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscriptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechTranscriptionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechTranscriptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + if (!$util.isInteger(message.maxAlternatives)) + return "maxAlternatives: integer expected"; + if (message.filterProfanity != null && message.hasOwnProperty("filterProfanity")) + if (typeof message.filterProfanity !== "boolean") + return "filterProfanity: boolean expected"; + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + if (typeof message.enableAutomaticPunctuation !== "boolean") + return "enableAutomaticPunctuation: boolean expected"; + if (message.audioTracks != null && message.hasOwnProperty("audioTracks")) { + if (!Array.isArray(message.audioTracks)) + return "audioTracks: array expected"; + for (var i = 0; i < message.audioTracks.length; ++i) + if (!$util.isInteger(message.audioTracks[i])) + return "audioTracks: integer[] expected"; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + if (typeof message.enableSpeakerDiarization !== "boolean") + return "enableSpeakerDiarization: boolean expected"; + if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount")) + if (!$util.isInteger(message.diarizationSpeakerCount)) + return "diarizationSpeakerCount: integer expected"; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + if (typeof message.enableWordConfidence !== "boolean") + return "enableWordConfidence: boolean expected"; + return null; + }; + + /** + * Creates a SpeechTranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig} SpeechTranscriptionConfig + */ + SpeechTranscriptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.maxAlternatives != null) + message.maxAlternatives = object.maxAlternatives | 0; + if (object.filterProfanity != null) + message.filterProfanity = Boolean(object.filterProfanity); + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.videointelligence.v1p3beta1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.enableAutomaticPunctuation != null) + message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation); + if (object.audioTracks) { + if (!Array.isArray(object.audioTracks)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.audioTracks: array expected"); + message.audioTracks = []; + for (var i = 0; i < object.audioTracks.length; ++i) + message.audioTracks[i] = object.audioTracks[i] | 0; + } + if (object.enableSpeakerDiarization != null) + message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization); + if (object.diarizationSpeakerCount != null) + message.diarizationSpeakerCount = object.diarizationSpeakerCount | 0; + if (object.enableWordConfidence != null) + message.enableWordConfidence = Boolean(object.enableWordConfidence); + return message; + }; + + /** + * Creates a plain object from a SpeechTranscriptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig} message SpeechTranscriptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechTranscriptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.speechContexts = []; + object.audioTracks = []; + } + if (options.defaults) { + object.languageCode = ""; + object.maxAlternatives = 0; + object.filterProfanity = false; + object.enableAutomaticPunctuation = false; + object.enableSpeakerDiarization = false; + object.diarizationSpeakerCount = 0; + object.enableWordConfidence = false; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives")) + object.maxAlternatives = message.maxAlternatives; + if (message.filterProfanity != null && message.hasOwnProperty("filterProfanity")) + object.filterProfanity = message.filterProfanity; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.videointelligence.v1p3beta1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation")) + object.enableAutomaticPunctuation = message.enableAutomaticPunctuation; + if (message.audioTracks && message.audioTracks.length) { + object.audioTracks = []; + for (var j = 0; j < message.audioTracks.length; ++j) + object.audioTracks[j] = message.audioTracks[j]; + } + if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization")) + object.enableSpeakerDiarization = message.enableSpeakerDiarization; + if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount")) + object.diarizationSpeakerCount = message.diarizationSpeakerCount; + if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence")) + object.enableWordConfidence = message.enableWordConfidence; + return object; + }; + + /** + * Converts this SpeechTranscriptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechTranscriptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechTranscriptionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechTranscriptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig"; + }; + + return SpeechTranscriptionConfig; + })(); + + v1p3beta1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function 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.videointelligence.v1p3beta1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.SpeechContext) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {google.cloud.videointelligence.v1p3beta1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechContext + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.SpeechContext"; + }; + + return SpeechContext; + })(); + + v1p3beta1.SpeechTranscription = (function() { + + /** + * Properties of a SpeechTranscription. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ISpeechTranscription + * @property {Array.|null} [alternatives] SpeechTranscription alternatives + * @property {string|null} [languageCode] SpeechTranscription languageCode + */ + + /** + * Constructs a new SpeechTranscription. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a SpeechTranscription. + * @implements ISpeechTranscription + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscription=} [properties] Properties to set + */ + function SpeechTranscription(properties) { + this.alternatives = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechTranscription alternatives. + * @member {Array.} alternatives + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @instance + */ + SpeechTranscription.prototype.alternatives = $util.emptyArray; + + /** + * SpeechTranscription languageCode. + * @member {string} languageCode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @instance + */ + SpeechTranscription.prototype.languageCode = ""; + + /** + * Creates a new SpeechTranscription instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscription=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscription} SpeechTranscription instance + */ + SpeechTranscription.create = function create(properties) { + return new SpeechTranscription(properties); + }; + + /** + * Encodes the specified SpeechTranscription message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscription.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscription} message SpeechTranscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alternatives != null && message.alternatives.length) + for (var i = 0; i < message.alternatives.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified SpeechTranscription message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechTranscription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechTranscription} message SpeechTranscription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechTranscription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscription} SpeechTranscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscription.decode = function 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.videointelligence.v1p3beta1.SpeechTranscription(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.alternatives && message.alternatives.length)) + message.alternatives = []; + message.alternatives.push($root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32())); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechTranscription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscription} SpeechTranscription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechTranscription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechTranscription message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechTranscription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alternatives != null && message.hasOwnProperty("alternatives")) { + if (!Array.isArray(message.alternatives)) + return "alternatives: array expected"; + for (var i = 0; i < message.alternatives.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]); + if (error) + return "alternatives." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a SpeechTranscription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechTranscription} SpeechTranscription + */ + SpeechTranscription.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.SpeechTranscription(); + if (object.alternatives) { + if (!Array.isArray(object.alternatives)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechTranscription.alternatives: array expected"); + message.alternatives = []; + for (var i = 0; i < object.alternatives.length; ++i) { + if (typeof object.alternatives[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechTranscription.alternatives: object expected"); + message.alternatives[i] = $root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]); + } + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a SpeechTranscription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {google.cloud.videointelligence.v1p3beta1.SpeechTranscription} message SpeechTranscription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechTranscription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternatives = []; + if (options.defaults) + object.languageCode = ""; + if (message.alternatives && message.alternatives.length) { + object.alternatives = []; + for (var j = 0; j < message.alternatives.length; ++j) + object.alternatives[j] = $root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this SpeechTranscription to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @instance + * @returns {Object.} JSON object + */ + SpeechTranscription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechTranscription + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechTranscription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechTranscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.SpeechTranscription"; + }; + + return SpeechTranscription; + })(); + + v1p3beta1.SpeechRecognitionAlternative = (function() { + + /** + * Properties of a SpeechRecognitionAlternative. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ISpeechRecognitionAlternative + * @property {string|null} [transcript] SpeechRecognitionAlternative transcript + * @property {number|null} [confidence] SpeechRecognitionAlternative confidence + * @property {Array.|null} [words] SpeechRecognitionAlternative words + */ + + /** + * Constructs a new SpeechRecognitionAlternative. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a SpeechRecognitionAlternative. + * @implements ISpeechRecognitionAlternative + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative=} [properties] Properties to set + */ + function SpeechRecognitionAlternative(properties) { + this.words = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechRecognitionAlternative transcript. + * @member {string} transcript + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.transcript = ""; + + /** + * SpeechRecognitionAlternative confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.confidence = 0; + + /** + * SpeechRecognitionAlternative words. + * @member {Array.} words + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @instance + */ + SpeechRecognitionAlternative.prototype.words = $util.emptyArray; + + /** + * Creates a new SpeechRecognitionAlternative instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance + */ + SpeechRecognitionAlternative.create = function create(properties) { + return new SpeechRecognitionAlternative(properties); + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.words != null && message.words.length) + for (var i = 0; i < message.words.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decode = function 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.videointelligence.v1p3beta1.SpeechRecognitionAlternative(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transcript = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.words && message.words.length)) + message.words = []; + message.words.push($root.google.cloud.videointelligence.v1p3beta1.WordInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechRecognitionAlternative message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechRecognitionAlternative.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.words != null && message.hasOwnProperty("words")) { + if (!Array.isArray(message.words)) + return "words: array expected"; + for (var i = 0; i < message.words.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.WordInfo.verify(message.words[i]); + if (error) + return "words." + error; + } + } + return null; + }; + + /** + * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative + */ + SpeechRecognitionAlternative.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative(); + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.words) { + if (!Array.isArray(object.words)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.words: array expected"); + message.words = []; + for (var i = 0; i < object.words.length; ++i) { + if (typeof object.words[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.words: object expected"); + message.words[i] = $root.google.cloud.videointelligence.v1p3beta1.WordInfo.fromObject(object.words[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechRecognitionAlternative.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.words = []; + if (options.defaults) { + object.transcript = ""; + object.confidence = 0; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.words && message.words.length) { + object.words = []; + for (var j = 0; j < message.words.length; ++j) + object.words[j] = $root.google.cloud.videointelligence.v1p3beta1.WordInfo.toObject(message.words[j], options); + } + return object; + }; + + /** + * Converts this SpeechRecognitionAlternative to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @instance + * @returns {Object.} JSON object + */ + SpeechRecognitionAlternative.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechRecognitionAlternative + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechRecognitionAlternative.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative"; + }; + + return SpeechRecognitionAlternative; + })(); + + v1p3beta1.WordInfo = (function() { + + /** + * Properties of a WordInfo. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IWordInfo + * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime + * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime + * @property {string|null} [word] WordInfo word + * @property {number|null} [confidence] WordInfo confidence + * @property {number|null} [speakerTag] WordInfo speakerTag + */ + + /** + * Constructs a new WordInfo. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a WordInfo. + * @implements IWordInfo + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IWordInfo=} [properties] Properties to set + */ + function WordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WordInfo startTime. + * @member {google.protobuf.IDuration|null|undefined} startTime + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @instance + */ + WordInfo.prototype.startTime = null; + + /** + * WordInfo endTime. + * @member {google.protobuf.IDuration|null|undefined} endTime + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @instance + */ + WordInfo.prototype.endTime = null; + + /** + * WordInfo word. + * @member {string} word + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @instance + */ + WordInfo.prototype.word = ""; + + /** + * WordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @instance + */ + WordInfo.prototype.confidence = 0; + + /** + * WordInfo speakerTag. + * @member {number} speakerTag + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @instance + */ + WordInfo.prototype.speakerTag = 0; + + /** + * Creates a new WordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IWordInfo=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.WordInfo} WordInfo instance + */ + WordInfo.create = function create(properties) { + return new WordInfo(properties); + }; + + /** + * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.WordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag); + return writer; + }; + + /** + * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.WordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IWordInfo} message WordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decode = function 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.videointelligence.v1p3beta1.WordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.word = reader.string(); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 5: { + message.speakerTag = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.WordInfo} WordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WordInfo message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Duration.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Duration.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + if (!$util.isInteger(message.speakerTag)) + return "speakerTag: integer expected"; + return null; + }; + + /** + * Creates a WordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.WordInfo} WordInfo + */ + WordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.WordInfo) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.WordInfo(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.WordInfo.startTime: object expected"); + message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.WordInfo.endTime: object expected"); + message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime); + } + if (object.word != null) + message.word = String(object.word); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speakerTag != null) + message.speakerTag = object.speakerTag | 0; + return message; + }; + + /** + * Creates a plain object from a WordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {google.cloud.videointelligence.v1p3beta1.WordInfo} message WordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.word = ""; + object.confidence = 0; + object.speakerTag = 0; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speakerTag != null && message.hasOwnProperty("speakerTag")) + object.speakerTag = message.speakerTag; + return object; + }; + + /** + * Converts this WordInfo to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @instance + * @returns {Object.} JSON object + */ + WordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WordInfo + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.WordInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WordInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.WordInfo"; + }; + + return WordInfo; + })(); + + v1p3beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function 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.videointelligence.v1p3beta1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.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 NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex(); + 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 NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {google.cloud.videointelligence.v1p3beta1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.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 NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1p3beta1.NormalizedBoundingPoly = (function() { + + /** + * Properties of a NormalizedBoundingPoly. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface INormalizedBoundingPoly + * @property {Array.|null} [vertices] NormalizedBoundingPoly vertices + */ + + /** + * Constructs a new NormalizedBoundingPoly. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a NormalizedBoundingPoly. + * @implements INormalizedBoundingPoly + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly=} [properties] Properties to set + */ + function NormalizedBoundingPoly(properties) { + this.vertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedBoundingPoly vertices. + * @member {Array.} vertices + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @instance + */ + NormalizedBoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * Creates a new NormalizedBoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly instance + */ + NormalizedBoundingPoly.create = function create(properties) { + return new NormalizedBoundingPoly(properties); + }; + + /** + * Encodes the specified NormalizedBoundingPoly message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vertices != null && message.vertices.length) + for (var i = 0; i < message.vertices.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.encode(message.vertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NormalizedBoundingPoly message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly} message NormalizedBoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedBoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decode = function 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.videointelligence.v1p3beta1.NormalizedBoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vertices && message.vertices.length)) + message.vertices = []; + message.vertices.push($root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedBoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedBoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedBoundingPoly message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedBoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vertices != null && message.hasOwnProperty("vertices")) { + if (!Array.isArray(message.vertices)) + return "vertices: array expected"; + for (var i = 0; i < message.vertices.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.verify(message.vertices[i]); + if (error) + return "vertices." + error; + } + } + return null; + }; + + /** + * Creates a NormalizedBoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly} NormalizedBoundingPoly + */ + NormalizedBoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.vertices: array expected"); + message.vertices = []; + for (var i = 0; i < object.vertices.length; ++i) { + if (typeof object.vertices[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.fromObject(object.vertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NormalizedBoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly} message NormalizedBoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedBoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vertices = []; + if (message.vertices && message.vertices.length) { + object.vertices = []; + for (var j = 0; j < message.vertices.length; ++j) + object.vertices[j] = $root.google.cloud.videointelligence.v1p3beta1.NormalizedVertex.toObject(message.vertices[j], options); + } + return object; + }; + + /** + * Converts this NormalizedBoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @instance + * @returns {Object.} JSON object + */ + NormalizedBoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedBoundingPoly + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedBoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly"; + }; + + return NormalizedBoundingPoly; + })(); + + v1p3beta1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ITextSegment + * @property {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null} [segment] TextSegment segment + * @property {number|null} [confidence] TextSegment confidence + * @property {Array.|null} [frames] TextSegment frames + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment segment. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @instance + */ + TextSegment.prototype.segment = null; + + /** + * TextSegment confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @instance + */ + TextSegment.prototype.confidence = 0; + + /** + * TextSegment frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @instance + */ + TextSegment.prototype.frames = $util.emptyArray; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.TextFrame.encode(message.frames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function 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.videointelligence.v1p3beta1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p3beta1.TextFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.TextFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.TextSegment) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.TextSegment(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextSegment.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segment); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextSegment.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextSegment.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p3beta1.TextFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {google.cloud.videointelligence.v1p3beta1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) { + object.segment = null; + object.confidence = 0; + } + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segment, options); + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p3beta1.TextFrame.toObject(message.frames[j], options); + } + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.TextSegment"; + }; + + return TextSegment; + })(); + + v1p3beta1.TextFrame = (function() { + + /** + * Properties of a TextFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ITextFrame + * @property {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly|null} [rotatedBoundingBox] TextFrame rotatedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] TextFrame timeOffset + */ + + /** + * Constructs a new TextFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a TextFrame. + * @implements ITextFrame + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ITextFrame=} [properties] Properties to set + */ + function TextFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextFrame rotatedBoundingBox. + * @member {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingPoly|null|undefined} rotatedBoundingBox + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @instance + */ + TextFrame.prototype.rotatedBoundingBox = null; + + /** + * TextFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @instance + */ + TextFrame.prototype.timeOffset = null; + + /** + * Creates a new TextFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.TextFrame} TextFrame instance + */ + TextFrame.create = function create(properties) { + return new TextFrame(properties); + }; + + /** + * Encodes the specified TextFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextFrame} message TextFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rotatedBoundingBox != null && Object.hasOwnProperty.call(message, "rotatedBoundingBox")) + $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.encode(message.rotatedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextFrame} message TextFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.TextFrame} TextFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFrame.decode = function 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.videointelligence.v1p3beta1.TextFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rotatedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.TextFrame} TextFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rotatedBoundingBox != null && message.hasOwnProperty("rotatedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.verify(message.rotatedBoundingBox); + if (error) + return "rotatedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates a TextFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.TextFrame} TextFrame + */ + TextFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.TextFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.TextFrame(); + if (object.rotatedBoundingBox != null) { + if (typeof object.rotatedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextFrame.rotatedBoundingBox: object expected"); + message.rotatedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.fromObject(object.rotatedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from a TextFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.TextFrame} message TextFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rotatedBoundingBox = null; + object.timeOffset = null; + } + if (message.rotatedBoundingBox != null && message.hasOwnProperty("rotatedBoundingBox")) + object.rotatedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.toObject(message.rotatedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this TextFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @instance + * @returns {Object.} JSON object + */ + TextFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.TextFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.TextFrame"; + }; + + return TextFrame; + })(); + + v1p3beta1.TextAnnotation = (function() { + + /** + * Properties of a TextAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ITextAnnotation + * @property {string|null} [text] TextAnnotation text + * @property {Array.|null} [segments] TextAnnotation segments + */ + + /** + * Constructs a new TextAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a TextAnnotation. + * @implements ITextAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ITextAnnotation=} [properties] Properties to set + */ + function TextAnnotation(properties) { + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextAnnotation text. + * @member {string} text + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.text = ""; + + /** + * TextAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @instance + */ + TextAnnotation.prototype.segments = $util.emptyArray; + + /** + * Creates a new TextAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.TextAnnotation} TextAnnotation instance + */ + TextAnnotation.create = function create(properties) { + return new TextAnnotation(properties); + }; + + /** + * Encodes the specified TextAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.TextSegment.encode(message.segments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.TextAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ITextAnnotation} message TextAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decode = function 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.videointelligence.v1p3beta1.TextAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p3beta1.TextSegment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.TextAnnotation} TextAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.TextSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + return null; + }; + + /** + * Creates a TextAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.TextAnnotation} TextAnnotation + */ + TextAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.TextAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.TextAnnotation(); + if (object.text != null) + message.text = String(object.text); + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.TextAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p3beta1.TextSegment.fromObject(object.segments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.TextAnnotation} message TextAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.segments = []; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p3beta1.TextSegment.toObject(message.segments[j], options); + } + return object; + }; + + /** + * Converts this TextAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.TextAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.TextAnnotation"; + }; + + return TextAnnotation; + })(); + + v1p3beta1.ObjectTrackingFrame = (function() { + + /** + * Properties of an ObjectTrackingFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IObjectTrackingFrame + * @property {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null} [normalizedBoundingBox] ObjectTrackingFrame normalizedBoundingBox + * @property {google.protobuf.IDuration|null} [timeOffset] ObjectTrackingFrame timeOffset + */ + + /** + * Constructs a new ObjectTrackingFrame. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an ObjectTrackingFrame. + * @implements IObjectTrackingFrame + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame=} [properties] Properties to set + */ + function ObjectTrackingFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingFrame normalizedBoundingBox. + * @member {google.cloud.videointelligence.v1p3beta1.INormalizedBoundingBox|null|undefined} normalizedBoundingBox + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.normalizedBoundingBox = null; + + /** + * ObjectTrackingFrame timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @instance + */ + ObjectTrackingFrame.prototype.timeOffset = null; + + /** + * Creates a new ObjectTrackingFrame instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame} ObjectTrackingFrame instance + */ + ObjectTrackingFrame.create = function create(properties) { + return new ObjectTrackingFrame(properties); + }; + + /** + * Encodes the specified ObjectTrackingFrame message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame} message ObjectTrackingFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingFrame.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedBoundingBox != null && Object.hasOwnProperty.call(message, "normalizedBoundingBox")) + $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.encode(message.normalizedBoundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingFrame message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingFrame} message ObjectTrackingFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame} ObjectTrackingFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingFrame.decode = function 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.videointelligence.v1p3beta1.ObjectTrackingFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.decode(reader, reader.uint32()); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame} ObjectTrackingFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingFrame message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingFrame.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.verify(message.normalizedBoundingBox); + if (error) + return "normalizedBoundingBox." + error; + } + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + return null; + }; + + /** + * Creates an ObjectTrackingFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame} ObjectTrackingFrame + */ + ObjectTrackingFrame.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame(); + if (object.normalizedBoundingBox != null) { + if (typeof object.normalizedBoundingBox !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.normalizedBoundingBox: object expected"); + message.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.fromObject(object.normalizedBoundingBox); + } + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame} message ObjectTrackingFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingFrame.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.normalizedBoundingBox = null; + object.timeOffset = null; + } + if (message.normalizedBoundingBox != null && message.hasOwnProperty("normalizedBoundingBox")) + object.normalizedBoundingBox = $root.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.toObject(message.normalizedBoundingBox, options); + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + return object; + }; + + /** + * Converts this ObjectTrackingFrame to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingFrame + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame"; + }; + + return ObjectTrackingFrame; + })(); + + v1p3beta1.ObjectTrackingAnnotation = (function() { + + /** + * Properties of an ObjectTrackingAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IObjectTrackingAnnotation + * @property {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null} [segment] ObjectTrackingAnnotation segment + * @property {number|Long|null} [trackId] ObjectTrackingAnnotation trackId + * @property {google.cloud.videointelligence.v1p3beta1.IEntity|null} [entity] ObjectTrackingAnnotation entity + * @property {number|null} [confidence] ObjectTrackingAnnotation confidence + * @property {Array.|null} [frames] ObjectTrackingAnnotation frames + */ + + /** + * Constructs a new ObjectTrackingAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents an ObjectTrackingAnnotation. + * @implements IObjectTrackingAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation=} [properties] Properties to set + */ + function ObjectTrackingAnnotation(properties) { + this.frames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectTrackingAnnotation segment. + * @member {google.cloud.videointelligence.v1p3beta1.IVideoSegment|null|undefined} segment + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.segment = null; + + /** + * ObjectTrackingAnnotation trackId. + * @member {number|Long|null|undefined} trackId + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.trackId = null; + + /** + * ObjectTrackingAnnotation entity. + * @member {google.cloud.videointelligence.v1p3beta1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.entity = null; + + /** + * ObjectTrackingAnnotation confidence. + * @member {number} confidence + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.confidence = 0; + + /** + * ObjectTrackingAnnotation frames. + * @member {Array.} frames + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + */ + ObjectTrackingAnnotation.prototype.frames = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ObjectTrackingAnnotation trackInfo. + * @member {"segment"|"trackId"|undefined} trackInfo + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + */ + Object.defineProperty(ObjectTrackingAnnotation.prototype, "trackInfo", { + get: $util.oneOfGetter($oneOfFields = ["segment", "trackId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ObjectTrackingAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation instance + */ + ObjectTrackingAnnotation.create = function create(properties) { + return new ObjectTrackingAnnotation(properties); + }; + + /** + * Encodes the specified ObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation} message ObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1p3beta1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.frames != null && message.frames.length) + for (var i = 0; i < message.frames.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.encode(message.frames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.trackId != null && Object.hasOwnProperty.call(message, "trackId")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.trackId); + return writer; + }; + + /** + * Encodes the specified ObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IObjectTrackingAnnotation} message ObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectTrackingAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingAnnotation.decode = function 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.videointelligence.v1p3beta1.ObjectTrackingAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32()); + break; + } + case 5: { + message.trackId = reader.int64(); + break; + } + case 1: { + message.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.decode(reader, reader.uint32()); + break; + } + case 4: { + message.confidence = reader.float(); + break; + } + case 2: { + if (!(message.frames && message.frames.length)) + message.frames = []; + message.frames.push($root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectTrackingAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectTrackingAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectTrackingAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.segment != null && message.hasOwnProperty("segment")) { + properties.trackInfo = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segment); + if (error) + return "segment." + error; + } + } + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (properties.trackInfo === 1) + return "trackInfo: multiple values"; + properties.trackInfo = 1; + if (!$util.isInteger(message.trackId) && !(message.trackId && $util.isInteger(message.trackId.low) && $util.isInteger(message.trackId.high))) + return "trackId: integer|Long expected"; + } + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.frames != null && message.hasOwnProperty("frames")) { + if (!Array.isArray(message.frames)) + return "frames: array expected"; + for (var i = 0; i < message.frames.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.verify(message.frames[i]); + if (error) + return "frames." + error; + } + } + return null; + }; + + /** + * Creates an ObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation} ObjectTrackingAnnotation + */ + ObjectTrackingAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.segment: object expected"); + message.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segment); + } + if (object.trackId != null) + if ($util.Long) + (message.trackId = $util.Long.fromValue(object.trackId)).unsigned = false; + else if (typeof object.trackId === "string") + message.trackId = parseInt(object.trackId, 10); + else if (typeof object.trackId === "number") + message.trackId = object.trackId; + else if (typeof object.trackId === "object") + message.trackId = new $util.LongBits(object.trackId.low >>> 0, object.trackId.high >>> 0).toNumber(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.fromObject(object.entity); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.frames) { + if (!Array.isArray(object.frames)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.frames: array expected"); + message.frames = []; + for (var i = 0; i < object.frames.length; ++i) { + if (typeof object.frames[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.frames: object expected"); + message.frames[i] = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.fromObject(object.frames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ObjectTrackingAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation} message ObjectTrackingAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectTrackingAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.frames = []; + if (options.defaults) { + object.entity = null; + object.confidence = 0; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.toObject(message.entity, options); + if (message.frames && message.frames.length) { + object.frames = []; + for (var j = 0; j < message.frames.length; ++j) + object.frames[j] = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.toObject(message.frames[j], options); + } + if (message.segment != null && message.hasOwnProperty("segment")) { + object.segment = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segment, options); + if (options.oneofs) + object.trackInfo = "segment"; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.trackId != null && message.hasOwnProperty("trackId")) { + if (typeof message.trackId === "number") + object.trackId = options.longs === String ? String(message.trackId) : message.trackId; + else + object.trackId = options.longs === String ? $util.Long.prototype.toString.call(message.trackId) : options.longs === Number ? new $util.LongBits(message.trackId.low >>> 0, message.trackId.high >>> 0).toNumber() : message.trackId; + if (options.oneofs) + object.trackInfo = "trackId"; + } + return object; + }; + + /** + * Converts this ObjectTrackingAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @instance + * @returns {Object.} JSON object + */ + ObjectTrackingAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectTrackingAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectTrackingAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation"; + }; + + return ObjectTrackingAnnotation; + })(); + + v1p3beta1.LogoRecognitionAnnotation = (function() { + + /** + * Properties of a LogoRecognitionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface ILogoRecognitionAnnotation + * @property {google.cloud.videointelligence.v1p3beta1.IEntity|null} [entity] LogoRecognitionAnnotation entity + * @property {Array.|null} [tracks] LogoRecognitionAnnotation tracks + * @property {Array.|null} [segments] LogoRecognitionAnnotation segments + */ + + /** + * Constructs a new LogoRecognitionAnnotation. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a LogoRecognitionAnnotation. + * @implements ILogoRecognitionAnnotation + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation=} [properties] Properties to set + */ + function LogoRecognitionAnnotation(properties) { + this.tracks = []; + this.segments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogoRecognitionAnnotation entity. + * @member {google.cloud.videointelligence.v1p3beta1.IEntity|null|undefined} entity + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @instance + */ + LogoRecognitionAnnotation.prototype.entity = null; + + /** + * LogoRecognitionAnnotation tracks. + * @member {Array.} tracks + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @instance + */ + LogoRecognitionAnnotation.prototype.tracks = $util.emptyArray; + + /** + * LogoRecognitionAnnotation segments. + * @member {Array.} segments + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @instance + */ + LogoRecognitionAnnotation.prototype.segments = $util.emptyArray; + + /** + * Creates a new LogoRecognitionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation} LogoRecognitionAnnotation instance + */ + LogoRecognitionAnnotation.create = function create(properties) { + return new LogoRecognitionAnnotation(properties); + }; + + /** + * Encodes the specified LogoRecognitionAnnotation message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation} message LogoRecognitionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogoRecognitionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.videointelligence.v1p3beta1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tracks != null && message.tracks.length) + for (var i = 0; i < message.tracks.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.Track.encode(message.tracks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.segments != null && message.segments.length) + for (var i = 0; i < message.segments.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.segments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogoRecognitionAnnotation message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.ILogoRecognitionAnnotation} message LogoRecognitionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogoRecognitionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation} LogoRecognitionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogoRecognitionAnnotation.decode = function 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.videointelligence.v1p3beta1.LogoRecognitionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.tracks && message.tracks.length)) + message.tracks = []; + message.tracks.push($root.google.cloud.videointelligence.v1p3beta1.Track.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.segments && message.segments.length)) + message.segments = []; + message.segments.push($root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogoRecognitionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation} LogoRecognitionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogoRecognitionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogoRecognitionAnnotation message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogoRecognitionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.tracks != null && message.hasOwnProperty("tracks")) { + if (!Array.isArray(message.tracks)) + return "tracks: array expected"; + for (var i = 0; i < message.tracks.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.Track.verify(message.tracks[i]); + if (error) + return "tracks." + error; + } + } + if (message.segments != null && message.hasOwnProperty("segments")) { + if (!Array.isArray(message.segments)) + return "segments: array expected"; + for (var i = 0; i < message.segments.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.segments[i]); + if (error) + return "segments." + error; + } + } + return null; + }; + + /** + * Creates a LogoRecognitionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation} LogoRecognitionAnnotation + */ + LogoRecognitionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.entity: object expected"); + message.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.fromObject(object.entity); + } + if (object.tracks) { + if (!Array.isArray(object.tracks)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.tracks: array expected"); + message.tracks = []; + for (var i = 0; i < object.tracks.length; ++i) { + if (typeof object.tracks[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.tracks: object expected"); + message.tracks[i] = $root.google.cloud.videointelligence.v1p3beta1.Track.fromObject(object.tracks[i]); + } + } + if (object.segments) { + if (!Array.isArray(object.segments)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.segments: array expected"); + message.segments = []; + for (var i = 0; i < object.segments.length; ++i) { + if (typeof object.segments[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.segments: object expected"); + message.segments[i] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.segments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LogoRecognitionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation} message LogoRecognitionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogoRecognitionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tracks = []; + object.segments = []; + } + if (options.defaults) + object.entity = null; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.cloud.videointelligence.v1p3beta1.Entity.toObject(message.entity, options); + if (message.tracks && message.tracks.length) { + object.tracks = []; + for (var j = 0; j < message.tracks.length; ++j) + object.tracks[j] = $root.google.cloud.videointelligence.v1p3beta1.Track.toObject(message.tracks[j], options); + } + if (message.segments && message.segments.length) { + object.segments = []; + for (var j = 0; j < message.segments.length; ++j) + object.segments[j] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.segments[j], options); + } + return object; + }; + + /** + * Converts this LogoRecognitionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @instance + * @returns {Object.} JSON object + */ + LogoRecognitionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogoRecognitionAnnotation + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogoRecognitionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation"; + }; + + return LogoRecognitionAnnotation; + })(); + + v1p3beta1.StreamingAnnotateVideoRequest = (function() { + + /** + * Properties of a StreamingAnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingAnnotateVideoRequest + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig|null} [videoConfig] StreamingAnnotateVideoRequest videoConfig + * @property {Uint8Array|null} [inputContent] StreamingAnnotateVideoRequest inputContent + */ + + /** + * Constructs a new StreamingAnnotateVideoRequest. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingAnnotateVideoRequest. + * @implements IStreamingAnnotateVideoRequest + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest=} [properties] Properties to set + */ + function StreamingAnnotateVideoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAnnotateVideoRequest videoConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig|null|undefined} videoConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @instance + */ + StreamingAnnotateVideoRequest.prototype.videoConfig = null; + + /** + * StreamingAnnotateVideoRequest inputContent. + * @member {Uint8Array|null|undefined} inputContent + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @instance + */ + StreamingAnnotateVideoRequest.prototype.inputContent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingAnnotateVideoRequest streamingRequest. + * @member {"videoConfig"|"inputContent"|undefined} streamingRequest + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @instance + */ + Object.defineProperty(StreamingAnnotateVideoRequest.prototype, "streamingRequest", { + get: $util.oneOfGetter($oneOfFields = ["videoConfig", "inputContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingAnnotateVideoRequest instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest} StreamingAnnotateVideoRequest instance + */ + StreamingAnnotateVideoRequest.create = function create(properties) { + return new StreamingAnnotateVideoRequest(properties); + }; + + /** + * Encodes the specified StreamingAnnotateVideoRequest message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest} message StreamingAnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnnotateVideoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.videoConfig != null && Object.hasOwnProperty.call(message, "videoConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.encode(message.videoConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inputContent != null && Object.hasOwnProperty.call(message, "inputContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.inputContent); + return writer; + }; + + /** + * Encodes the specified StreamingAnnotateVideoRequest message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoRequest} message StreamingAnnotateVideoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnnotateVideoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAnnotateVideoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest} StreamingAnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnnotateVideoRequest.decode = function 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.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.videoConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.inputContent = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAnnotateVideoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest} StreamingAnnotateVideoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnnotateVideoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAnnotateVideoRequest message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAnnotateVideoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.videoConfig != null && message.hasOwnProperty("videoConfig")) { + properties.streamingRequest = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.verify(message.videoConfig); + if (error) + return "videoConfig." + error; + } + } + if (message.inputContent != null && message.hasOwnProperty("inputContent")) { + if (properties.streamingRequest === 1) + return "streamingRequest: multiple values"; + properties.streamingRequest = 1; + if (!(message.inputContent && typeof message.inputContent.length === "number" || $util.isString(message.inputContent))) + return "inputContent: buffer expected"; + } + return null; + }; + + /** + * Creates a StreamingAnnotateVideoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest} StreamingAnnotateVideoRequest + */ + StreamingAnnotateVideoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest(); + if (object.videoConfig != null) { + if (typeof object.videoConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.videoConfig: object expected"); + message.videoConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.fromObject(object.videoConfig); + } + if (object.inputContent != null) + if (typeof object.inputContent === "string") + $util.base64.decode(object.inputContent, message.inputContent = $util.newBuffer($util.base64.length(object.inputContent)), 0); + else if (object.inputContent.length >= 0) + message.inputContent = object.inputContent; + return message; + }; + + /** + * Creates a plain object from a StreamingAnnotateVideoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest} message StreamingAnnotateVideoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAnnotateVideoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.videoConfig != null && message.hasOwnProperty("videoConfig")) { + object.videoConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.toObject(message.videoConfig, options); + if (options.oneofs) + object.streamingRequest = "videoConfig"; + } + if (message.inputContent != null && message.hasOwnProperty("inputContent")) { + object.inputContent = options.bytes === String ? $util.base64.encode(message.inputContent, 0, message.inputContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputContent) : message.inputContent; + if (options.oneofs) + object.streamingRequest = "inputContent"; + } + return object; + }; + + /** + * Converts this StreamingAnnotateVideoRequest to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingAnnotateVideoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingAnnotateVideoRequest + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingAnnotateVideoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest"; + }; + + return StreamingAnnotateVideoRequest; + })(); + + v1p3beta1.StreamingVideoConfig = (function() { + + /** + * Properties of a StreamingVideoConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingVideoConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig|null} [shotChangeDetectionConfig] StreamingVideoConfig shotChangeDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig|null} [labelDetectionConfig] StreamingVideoConfig labelDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig|null} [explicitContentDetectionConfig] StreamingVideoConfig explicitContentDetectionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig|null} [objectTrackingConfig] StreamingVideoConfig objectTrackingConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig|null} [automlActionRecognitionConfig] StreamingVideoConfig automlActionRecognitionConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig|null} [automlClassificationConfig] StreamingVideoConfig automlClassificationConfig + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig|null} [automlObjectTrackingConfig] StreamingVideoConfig automlObjectTrackingConfig + * @property {google.cloud.videointelligence.v1p3beta1.StreamingFeature|null} [feature] StreamingVideoConfig feature + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig|null} [storageConfig] StreamingVideoConfig storageConfig + */ + + /** + * Constructs a new StreamingVideoConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingVideoConfig. + * @implements IStreamingVideoConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig=} [properties] Properties to set + */ + function StreamingVideoConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingVideoConfig shotChangeDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig|null|undefined} shotChangeDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.shotChangeDetectionConfig = null; + + /** + * StreamingVideoConfig labelDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig|null|undefined} labelDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.labelDetectionConfig = null; + + /** + * StreamingVideoConfig explicitContentDetectionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig|null|undefined} explicitContentDetectionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.explicitContentDetectionConfig = null; + + /** + * StreamingVideoConfig objectTrackingConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig|null|undefined} objectTrackingConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.objectTrackingConfig = null; + + /** + * StreamingVideoConfig automlActionRecognitionConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig|null|undefined} automlActionRecognitionConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.automlActionRecognitionConfig = null; + + /** + * StreamingVideoConfig automlClassificationConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig|null|undefined} automlClassificationConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.automlClassificationConfig = null; + + /** + * StreamingVideoConfig automlObjectTrackingConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig|null|undefined} automlObjectTrackingConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.automlObjectTrackingConfig = null; + + /** + * StreamingVideoConfig feature. + * @member {google.cloud.videointelligence.v1p3beta1.StreamingFeature} feature + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.feature = 0; + + /** + * StreamingVideoConfig storageConfig. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig|null|undefined} storageConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + StreamingVideoConfig.prototype.storageConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingVideoConfig streamingConfig. + * @member {"shotChangeDetectionConfig"|"labelDetectionConfig"|"explicitContentDetectionConfig"|"objectTrackingConfig"|"automlActionRecognitionConfig"|"automlClassificationConfig"|"automlObjectTrackingConfig"|undefined} streamingConfig + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + */ + Object.defineProperty(StreamingVideoConfig.prototype, "streamingConfig", { + get: $util.oneOfGetter($oneOfFields = ["shotChangeDetectionConfig", "labelDetectionConfig", "explicitContentDetectionConfig", "objectTrackingConfig", "automlActionRecognitionConfig", "automlClassificationConfig", "automlObjectTrackingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingVideoConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig} StreamingVideoConfig instance + */ + StreamingVideoConfig.create = function create(properties) { + return new StreamingVideoConfig(properties); + }; + + /** + * Encodes the specified StreamingVideoConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig} message StreamingVideoConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingVideoConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feature != null && Object.hasOwnProperty.call(message, "feature")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.feature); + if (message.shotChangeDetectionConfig != null && Object.hasOwnProperty.call(message, "shotChangeDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.encode(message.shotChangeDetectionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.labelDetectionConfig != null && Object.hasOwnProperty.call(message, "labelDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.encode(message.labelDetectionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explicitContentDetectionConfig != null && Object.hasOwnProperty.call(message, "explicitContentDetectionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.encode(message.explicitContentDetectionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.objectTrackingConfig != null && Object.hasOwnProperty.call(message, "objectTrackingConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.encode(message.objectTrackingConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.automlClassificationConfig != null && Object.hasOwnProperty.call(message, "automlClassificationConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.encode(message.automlClassificationConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.automlObjectTrackingConfig != null && Object.hasOwnProperty.call(message, "automlObjectTrackingConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.encode(message.automlObjectTrackingConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.automlActionRecognitionConfig != null && Object.hasOwnProperty.call(message, "automlActionRecognitionConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.encode(message.automlActionRecognitionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.storageConfig != null && Object.hasOwnProperty.call(message, "storageConfig")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.encode(message.storageConfig, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingVideoConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoConfig} message StreamingVideoConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingVideoConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingVideoConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig} StreamingVideoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingVideoConfig.decode = function 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.videointelligence.v1p3beta1.StreamingVideoConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.objectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.automlActionRecognitionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.decode(reader, reader.uint32()); + break; + } + case 21: { + message.automlClassificationConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.decode(reader, reader.uint32()); + break; + } + case 22: { + message.automlObjectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.feature = reader.int32(); + break; + } + case 30: { + message.storageConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingVideoConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig} StreamingVideoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingVideoConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingVideoConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingVideoConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.verify(message.shotChangeDetectionConfig); + if (error) + return "shotChangeDetectionConfig." + error; + } + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + if (properties.streamingConfig === 1) + return "streamingConfig: multiple values"; + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.verify(message.labelDetectionConfig); + if (error) + return "labelDetectionConfig." + error; + } + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + if (properties.streamingConfig === 1) + return "streamingConfig: multiple values"; + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.verify(message.explicitContentDetectionConfig); + if (error) + return "explicitContentDetectionConfig." + error; + } + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + if (properties.streamingConfig === 1) + return "streamingConfig: multiple values"; + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.verify(message.objectTrackingConfig); + if (error) + return "objectTrackingConfig." + error; + } + } + if (message.automlActionRecognitionConfig != null && message.hasOwnProperty("automlActionRecognitionConfig")) { + if (properties.streamingConfig === 1) + return "streamingConfig: multiple values"; + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.verify(message.automlActionRecognitionConfig); + if (error) + return "automlActionRecognitionConfig." + error; + } + } + if (message.automlClassificationConfig != null && message.hasOwnProperty("automlClassificationConfig")) { + if (properties.streamingConfig === 1) + return "streamingConfig: multiple values"; + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.verify(message.automlClassificationConfig); + if (error) + return "automlClassificationConfig." + error; + } + } + if (message.automlObjectTrackingConfig != null && message.hasOwnProperty("automlObjectTrackingConfig")) { + if (properties.streamingConfig === 1) + return "streamingConfig: multiple values"; + properties.streamingConfig = 1; + { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.verify(message.automlObjectTrackingConfig); + if (error) + return "automlObjectTrackingConfig." + error; + } + } + if (message.feature != null && message.hasOwnProperty("feature")) + switch (message.feature) { + default: + return "feature: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 23: + case 21: + case 22: + break; + } + if (message.storageConfig != null && message.hasOwnProperty("storageConfig")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.verify(message.storageConfig); + if (error) + return "storageConfig." + error; + } + return null; + }; + + /** + * Creates a StreamingVideoConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig} StreamingVideoConfig + */ + StreamingVideoConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig(); + if (object.shotChangeDetectionConfig != null) { + if (typeof object.shotChangeDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.shotChangeDetectionConfig: object expected"); + message.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.fromObject(object.shotChangeDetectionConfig); + } + if (object.labelDetectionConfig != null) { + if (typeof object.labelDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.labelDetectionConfig: object expected"); + message.labelDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.fromObject(object.labelDetectionConfig); + } + if (object.explicitContentDetectionConfig != null) { + if (typeof object.explicitContentDetectionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.explicitContentDetectionConfig: object expected"); + message.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.fromObject(object.explicitContentDetectionConfig); + } + if (object.objectTrackingConfig != null) { + if (typeof object.objectTrackingConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.objectTrackingConfig: object expected"); + message.objectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.fromObject(object.objectTrackingConfig); + } + if (object.automlActionRecognitionConfig != null) { + if (typeof object.automlActionRecognitionConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.automlActionRecognitionConfig: object expected"); + message.automlActionRecognitionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.fromObject(object.automlActionRecognitionConfig); + } + if (object.automlClassificationConfig != null) { + if (typeof object.automlClassificationConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.automlClassificationConfig: object expected"); + message.automlClassificationConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.fromObject(object.automlClassificationConfig); + } + if (object.automlObjectTrackingConfig != null) { + if (typeof object.automlObjectTrackingConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.automlObjectTrackingConfig: object expected"); + message.automlObjectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.fromObject(object.automlObjectTrackingConfig); + } + switch (object.feature) { + default: + if (typeof object.feature === "number") { + message.feature = object.feature; + break; + } + break; + case "STREAMING_FEATURE_UNSPECIFIED": + case 0: + message.feature = 0; + break; + case "STREAMING_LABEL_DETECTION": + case 1: + message.feature = 1; + break; + case "STREAMING_SHOT_CHANGE_DETECTION": + case 2: + message.feature = 2; + break; + case "STREAMING_EXPLICIT_CONTENT_DETECTION": + case 3: + message.feature = 3; + break; + case "STREAMING_OBJECT_TRACKING": + case 4: + message.feature = 4; + break; + case "STREAMING_AUTOML_ACTION_RECOGNITION": + case 23: + message.feature = 23; + break; + case "STREAMING_AUTOML_CLASSIFICATION": + case 21: + message.feature = 21; + break; + case "STREAMING_AUTOML_OBJECT_TRACKING": + case 22: + message.feature = 22; + break; + } + if (object.storageConfig != null) { + if (typeof object.storageConfig !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.storageConfig: object expected"); + message.storageConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.fromObject(object.storageConfig); + } + return message; + }; + + /** + * Creates a plain object from a StreamingVideoConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig} message StreamingVideoConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingVideoConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.feature = options.enums === String ? "STREAMING_FEATURE_UNSPECIFIED" : 0; + object.storageConfig = null; + } + if (message.feature != null && message.hasOwnProperty("feature")) + object.feature = options.enums === String ? $root.google.cloud.videointelligence.v1p3beta1.StreamingFeature[message.feature] === undefined ? message.feature : $root.google.cloud.videointelligence.v1p3beta1.StreamingFeature[message.feature] : message.feature; + if (message.shotChangeDetectionConfig != null && message.hasOwnProperty("shotChangeDetectionConfig")) { + object.shotChangeDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.toObject(message.shotChangeDetectionConfig, options); + if (options.oneofs) + object.streamingConfig = "shotChangeDetectionConfig"; + } + if (message.labelDetectionConfig != null && message.hasOwnProperty("labelDetectionConfig")) { + object.labelDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.toObject(message.labelDetectionConfig, options); + if (options.oneofs) + object.streamingConfig = "labelDetectionConfig"; + } + if (message.explicitContentDetectionConfig != null && message.hasOwnProperty("explicitContentDetectionConfig")) { + object.explicitContentDetectionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.toObject(message.explicitContentDetectionConfig, options); + if (options.oneofs) + object.streamingConfig = "explicitContentDetectionConfig"; + } + if (message.objectTrackingConfig != null && message.hasOwnProperty("objectTrackingConfig")) { + object.objectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.toObject(message.objectTrackingConfig, options); + if (options.oneofs) + object.streamingConfig = "objectTrackingConfig"; + } + if (message.automlClassificationConfig != null && message.hasOwnProperty("automlClassificationConfig")) { + object.automlClassificationConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.toObject(message.automlClassificationConfig, options); + if (options.oneofs) + object.streamingConfig = "automlClassificationConfig"; + } + if (message.automlObjectTrackingConfig != null && message.hasOwnProperty("automlObjectTrackingConfig")) { + object.automlObjectTrackingConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.toObject(message.automlObjectTrackingConfig, options); + if (options.oneofs) + object.streamingConfig = "automlObjectTrackingConfig"; + } + if (message.automlActionRecognitionConfig != null && message.hasOwnProperty("automlActionRecognitionConfig")) { + object.automlActionRecognitionConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.toObject(message.automlActionRecognitionConfig, options); + if (options.oneofs) + object.streamingConfig = "automlActionRecognitionConfig"; + } + if (message.storageConfig != null && message.hasOwnProperty("storageConfig")) + object.storageConfig = $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.toObject(message.storageConfig, options); + return object; + }; + + /** + * Converts this StreamingVideoConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingVideoConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingVideoConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingVideoConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig"; + }; + + return StreamingVideoConfig; + })(); + + v1p3beta1.StreamingAnnotateVideoResponse = (function() { + + /** + * Properties of a StreamingAnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingAnnotateVideoResponse + * @property {google.rpc.IStatus|null} [error] StreamingAnnotateVideoResponse error + * @property {google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults|null} [annotationResults] StreamingAnnotateVideoResponse annotationResults + * @property {string|null} [annotationResultsUri] StreamingAnnotateVideoResponse annotationResultsUri + */ + + /** + * Constructs a new StreamingAnnotateVideoResponse. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingAnnotateVideoResponse. + * @implements IStreamingAnnotateVideoResponse + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse=} [properties] Properties to set + */ + function StreamingAnnotateVideoResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAnnotateVideoResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @instance + */ + StreamingAnnotateVideoResponse.prototype.error = null; + + /** + * StreamingAnnotateVideoResponse annotationResults. + * @member {google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults|null|undefined} annotationResults + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @instance + */ + StreamingAnnotateVideoResponse.prototype.annotationResults = null; + + /** + * StreamingAnnotateVideoResponse annotationResultsUri. + * @member {string} annotationResultsUri + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @instance + */ + StreamingAnnotateVideoResponse.prototype.annotationResultsUri = ""; + + /** + * Creates a new StreamingAnnotateVideoResponse instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} StreamingAnnotateVideoResponse instance + */ + StreamingAnnotateVideoResponse.create = function create(properties) { + return new StreamingAnnotateVideoResponse(properties); + }; + + /** + * Encodes the specified StreamingAnnotateVideoResponse message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse} message StreamingAnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnnotateVideoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annotationResults != null && Object.hasOwnProperty.call(message, "annotationResults")) + $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.encode(message.annotationResults, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.annotationResultsUri != null && Object.hasOwnProperty.call(message, "annotationResultsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.annotationResultsUri); + return writer; + }; + + /** + * Encodes the specified StreamingAnnotateVideoResponse message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAnnotateVideoResponse} message StreamingAnnotateVideoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnnotateVideoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAnnotateVideoResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} StreamingAnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnnotateVideoResponse.decode = function 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.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.annotationResults = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.decode(reader, reader.uint32()); + break; + } + case 3: { + message.annotationResultsUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAnnotateVideoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} StreamingAnnotateVideoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnnotateVideoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAnnotateVideoResponse message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAnnotateVideoResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.verify(message.annotationResults); + if (error) + return "annotationResults." + error; + } + if (message.annotationResultsUri != null && message.hasOwnProperty("annotationResultsUri")) + if (!$util.isString(message.annotationResultsUri)) + return "annotationResultsUri: string expected"; + return null; + }; + + /** + * Creates a StreamingAnnotateVideoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} StreamingAnnotateVideoResponse + */ + StreamingAnnotateVideoResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.annotationResults != null) { + if (typeof object.annotationResults !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.annotationResults: object expected"); + message.annotationResults = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.fromObject(object.annotationResults); + } + if (object.annotationResultsUri != null) + message.annotationResultsUri = String(object.annotationResultsUri); + return message; + }; + + /** + * Creates a plain object from a StreamingAnnotateVideoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} message StreamingAnnotateVideoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAnnotateVideoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.error = null; + object.annotationResults = null; + object.annotationResultsUri = ""; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.annotationResults != null && message.hasOwnProperty("annotationResults")) + object.annotationResults = $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.toObject(message.annotationResults, options); + if (message.annotationResultsUri != null && message.hasOwnProperty("annotationResultsUri")) + object.annotationResultsUri = message.annotationResultsUri; + return object; + }; + + /** + * Converts this StreamingAnnotateVideoResponse to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingAnnotateVideoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingAnnotateVideoResponse + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingAnnotateVideoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse"; + }; + + return StreamingAnnotateVideoResponse; + })(); + + v1p3beta1.StreamingVideoAnnotationResults = (function() { + + /** + * Properties of a StreamingVideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingVideoAnnotationResults + * @property {Array.|null} [shotAnnotations] StreamingVideoAnnotationResults shotAnnotations + * @property {Array.|null} [labelAnnotations] StreamingVideoAnnotationResults labelAnnotations + * @property {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null} [explicitAnnotation] StreamingVideoAnnotationResults explicitAnnotation + * @property {Array.|null} [objectAnnotations] StreamingVideoAnnotationResults objectAnnotations + */ + + /** + * Constructs a new StreamingVideoAnnotationResults. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingVideoAnnotationResults. + * @implements IStreamingVideoAnnotationResults + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults=} [properties] Properties to set + */ + function StreamingVideoAnnotationResults(properties) { + this.shotAnnotations = []; + this.labelAnnotations = []; + this.objectAnnotations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingVideoAnnotationResults shotAnnotations. + * @member {Array.} shotAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @instance + */ + StreamingVideoAnnotationResults.prototype.shotAnnotations = $util.emptyArray; + + /** + * StreamingVideoAnnotationResults labelAnnotations. + * @member {Array.} labelAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @instance + */ + StreamingVideoAnnotationResults.prototype.labelAnnotations = $util.emptyArray; + + /** + * StreamingVideoAnnotationResults explicitAnnotation. + * @member {google.cloud.videointelligence.v1p3beta1.IExplicitContentAnnotation|null|undefined} explicitAnnotation + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @instance + */ + StreamingVideoAnnotationResults.prototype.explicitAnnotation = null; + + /** + * StreamingVideoAnnotationResults objectAnnotations. + * @member {Array.} objectAnnotations + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @instance + */ + StreamingVideoAnnotationResults.prototype.objectAnnotations = $util.emptyArray; + + /** + * Creates a new StreamingVideoAnnotationResults instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults} StreamingVideoAnnotationResults instance + */ + StreamingVideoAnnotationResults.create = function create(properties) { + return new StreamingVideoAnnotationResults(properties); + }; + + /** + * Encodes the specified StreamingVideoAnnotationResults message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults} message StreamingVideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingVideoAnnotationResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shotAnnotations != null && message.shotAnnotations.length) + for (var i = 0; i < message.shotAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.encode(message.shotAnnotations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labelAnnotations != null && message.labelAnnotations.length) + for (var i = 0; i < message.labelAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.encode(message.labelAnnotations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.explicitAnnotation != null && Object.hasOwnProperty.call(message, "explicitAnnotation")) + $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.encode(message.explicitAnnotation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.objectAnnotations != null && message.objectAnnotations.length) + for (var i = 0; i < message.objectAnnotations.length; ++i) + $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.encode(message.objectAnnotations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingVideoAnnotationResults message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingVideoAnnotationResults} message StreamingVideoAnnotationResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingVideoAnnotationResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingVideoAnnotationResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults} StreamingVideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingVideoAnnotationResults.decode = function 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.videointelligence.v1p3beta1.StreamingVideoAnnotationResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.shotAnnotations && message.shotAnnotations.length)) + message.shotAnnotations = []; + message.shotAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.VideoSegment.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.labelAnnotations && message.labelAnnotations.length)) + message.labelAnnotations = []; + message.labelAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.decode(reader, reader.uint32())); + break; + } + case 3: { + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.objectAnnotations && message.objectAnnotations.length)) + message.objectAnnotations = []; + message.objectAnnotations.push($root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingVideoAnnotationResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults} StreamingVideoAnnotationResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingVideoAnnotationResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingVideoAnnotationResults message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingVideoAnnotationResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shotAnnotations != null && message.hasOwnProperty("shotAnnotations")) { + if (!Array.isArray(message.shotAnnotations)) + return "shotAnnotations: array expected"; + for (var i = 0; i < message.shotAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.verify(message.shotAnnotations[i]); + if (error) + return "shotAnnotations." + error; + } + } + if (message.labelAnnotations != null && message.hasOwnProperty("labelAnnotations")) { + if (!Array.isArray(message.labelAnnotations)) + return "labelAnnotations: array expected"; + for (var i = 0; i < message.labelAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.verify(message.labelAnnotations[i]); + if (error) + return "labelAnnotations." + error; + } + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.verify(message.explicitAnnotation); + if (error) + return "explicitAnnotation." + error; + } + if (message.objectAnnotations != null && message.hasOwnProperty("objectAnnotations")) { + if (!Array.isArray(message.objectAnnotations)) + return "objectAnnotations: array expected"; + for (var i = 0; i < message.objectAnnotations.length; ++i) { + var error = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.verify(message.objectAnnotations[i]); + if (error) + return "objectAnnotations." + error; + } + } + return null; + }; + + /** + * Creates a StreamingVideoAnnotationResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults} StreamingVideoAnnotationResults + */ + StreamingVideoAnnotationResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults(); + if (object.shotAnnotations) { + if (!Array.isArray(object.shotAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.shotAnnotations: array expected"); + message.shotAnnotations = []; + for (var i = 0; i < object.shotAnnotations.length; ++i) { + if (typeof object.shotAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.shotAnnotations: object expected"); + message.shotAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.fromObject(object.shotAnnotations[i]); + } + } + if (object.labelAnnotations) { + if (!Array.isArray(object.labelAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.labelAnnotations: array expected"); + message.labelAnnotations = []; + for (var i = 0; i < object.labelAnnotations.length; ++i) { + if (typeof object.labelAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.labelAnnotations: object expected"); + message.labelAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.fromObject(object.labelAnnotations[i]); + } + } + if (object.explicitAnnotation != null) { + if (typeof object.explicitAnnotation !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.explicitAnnotation: object expected"); + message.explicitAnnotation = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.fromObject(object.explicitAnnotation); + } + if (object.objectAnnotations) { + if (!Array.isArray(object.objectAnnotations)) + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.objectAnnotations: array expected"); + message.objectAnnotations = []; + for (var i = 0; i < object.objectAnnotations.length; ++i) { + if (typeof object.objectAnnotations[i] !== "object") + throw TypeError(".google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.objectAnnotations: object expected"); + message.objectAnnotations[i] = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.fromObject(object.objectAnnotations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StreamingVideoAnnotationResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults} message StreamingVideoAnnotationResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingVideoAnnotationResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.shotAnnotations = []; + object.labelAnnotations = []; + object.objectAnnotations = []; + } + if (options.defaults) + object.explicitAnnotation = null; + if (message.shotAnnotations && message.shotAnnotations.length) { + object.shotAnnotations = []; + for (var j = 0; j < message.shotAnnotations.length; ++j) + object.shotAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.VideoSegment.toObject(message.shotAnnotations[j], options); + } + if (message.labelAnnotations && message.labelAnnotations.length) { + object.labelAnnotations = []; + for (var j = 0; j < message.labelAnnotations.length; ++j) + object.labelAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.LabelAnnotation.toObject(message.labelAnnotations[j], options); + } + if (message.explicitAnnotation != null && message.hasOwnProperty("explicitAnnotation")) + object.explicitAnnotation = $root.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.toObject(message.explicitAnnotation, options); + if (message.objectAnnotations && message.objectAnnotations.length) { + object.objectAnnotations = []; + for (var j = 0; j < message.objectAnnotations.length; ++j) + object.objectAnnotations[j] = $root.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.toObject(message.objectAnnotations[j], options); + } + return object; + }; + + /** + * Converts this StreamingVideoAnnotationResults to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @instance + * @returns {Object.} JSON object + */ + StreamingVideoAnnotationResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingVideoAnnotationResults + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingVideoAnnotationResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults"; + }; + + return StreamingVideoAnnotationResults; + })(); + + v1p3beta1.StreamingShotChangeDetectionConfig = (function() { + + /** + * Properties of a StreamingShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingShotChangeDetectionConfig + */ + + /** + * Constructs a new StreamingShotChangeDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingShotChangeDetectionConfig. + * @implements IStreamingShotChangeDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig=} [properties] Properties to set + */ + function StreamingShotChangeDetectionConfig(properties) { + if (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 StreamingShotChangeDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig} StreamingShotChangeDetectionConfig instance + */ + StreamingShotChangeDetectionConfig.create = function create(properties) { + return new StreamingShotChangeDetectionConfig(properties); + }; + + /** + * Encodes the specified StreamingShotChangeDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig} message StreamingShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingShotChangeDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StreamingShotChangeDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingShotChangeDetectionConfig} message StreamingShotChangeDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingShotChangeDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingShotChangeDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig} StreamingShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingShotChangeDetectionConfig.decode = function 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.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingShotChangeDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig} StreamingShotChangeDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingShotChangeDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingShotChangeDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingShotChangeDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StreamingShotChangeDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig} StreamingShotChangeDetectionConfig + */ + StreamingShotChangeDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig) + return object; + return new $root.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig(); + }; + + /** + * Creates a plain object from a StreamingShotChangeDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig} message StreamingShotChangeDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingShotChangeDetectionConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StreamingShotChangeDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingShotChangeDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingShotChangeDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingShotChangeDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig"; + }; + + return StreamingShotChangeDetectionConfig; + })(); + + v1p3beta1.StreamingLabelDetectionConfig = (function() { + + /** + * Properties of a StreamingLabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingLabelDetectionConfig + * @property {boolean|null} [stationaryCamera] StreamingLabelDetectionConfig stationaryCamera + */ + + /** + * Constructs a new StreamingLabelDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingLabelDetectionConfig. + * @implements IStreamingLabelDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig=} [properties] Properties to set + */ + function StreamingLabelDetectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingLabelDetectionConfig stationaryCamera. + * @member {boolean} stationaryCamera + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @instance + */ + StreamingLabelDetectionConfig.prototype.stationaryCamera = false; + + /** + * Creates a new StreamingLabelDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig} StreamingLabelDetectionConfig instance + */ + StreamingLabelDetectionConfig.create = function create(properties) { + return new StreamingLabelDetectionConfig(properties); + }; + + /** + * Encodes the specified StreamingLabelDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig} message StreamingLabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingLabelDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stationaryCamera != null && Object.hasOwnProperty.call(message, "stationaryCamera")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.stationaryCamera); + return writer; + }; + + /** + * Encodes the specified StreamingLabelDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingLabelDetectionConfig} message StreamingLabelDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingLabelDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingLabelDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig} StreamingLabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingLabelDetectionConfig.decode = function 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.videointelligence.v1p3beta1.StreamingLabelDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stationaryCamera = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingLabelDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig} StreamingLabelDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingLabelDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingLabelDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingLabelDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + if (typeof message.stationaryCamera !== "boolean") + return "stationaryCamera: boolean expected"; + return null; + }; + + /** + * Creates a StreamingLabelDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig} StreamingLabelDetectionConfig + */ + StreamingLabelDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig(); + if (object.stationaryCamera != null) + message.stationaryCamera = Boolean(object.stationaryCamera); + return message; + }; + + /** + * Creates a plain object from a StreamingLabelDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig} message StreamingLabelDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingLabelDetectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.stationaryCamera = false; + if (message.stationaryCamera != null && message.hasOwnProperty("stationaryCamera")) + object.stationaryCamera = message.stationaryCamera; + return object; + }; + + /** + * Converts this StreamingLabelDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingLabelDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingLabelDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingLabelDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig"; + }; + + return StreamingLabelDetectionConfig; + })(); + + v1p3beta1.StreamingExplicitContentDetectionConfig = (function() { + + /** + * Properties of a StreamingExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingExplicitContentDetectionConfig + */ + + /** + * Constructs a new StreamingExplicitContentDetectionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingExplicitContentDetectionConfig. + * @implements IStreamingExplicitContentDetectionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig=} [properties] Properties to set + */ + function StreamingExplicitContentDetectionConfig(properties) { + if (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 StreamingExplicitContentDetectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig} StreamingExplicitContentDetectionConfig instance + */ + StreamingExplicitContentDetectionConfig.create = function create(properties) { + return new StreamingExplicitContentDetectionConfig(properties); + }; + + /** + * Encodes the specified StreamingExplicitContentDetectionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig} message StreamingExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingExplicitContentDetectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StreamingExplicitContentDetectionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingExplicitContentDetectionConfig} message StreamingExplicitContentDetectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingExplicitContentDetectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingExplicitContentDetectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig} StreamingExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingExplicitContentDetectionConfig.decode = function 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.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingExplicitContentDetectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig} StreamingExplicitContentDetectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingExplicitContentDetectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingExplicitContentDetectionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingExplicitContentDetectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StreamingExplicitContentDetectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig} StreamingExplicitContentDetectionConfig + */ + StreamingExplicitContentDetectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig) + return object; + return new $root.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig(); + }; + + /** + * Creates a plain object from a StreamingExplicitContentDetectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig} message StreamingExplicitContentDetectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingExplicitContentDetectionConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StreamingExplicitContentDetectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingExplicitContentDetectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingExplicitContentDetectionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingExplicitContentDetectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig"; + }; + + return StreamingExplicitContentDetectionConfig; + })(); + + v1p3beta1.StreamingObjectTrackingConfig = (function() { + + /** + * Properties of a StreamingObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingObjectTrackingConfig + */ + + /** + * Constructs a new StreamingObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingObjectTrackingConfig. + * @implements IStreamingObjectTrackingConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig=} [properties] Properties to set + */ + function StreamingObjectTrackingConfig(properties) { + if (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 StreamingObjectTrackingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig} StreamingObjectTrackingConfig instance + */ + StreamingObjectTrackingConfig.create = function create(properties) { + return new StreamingObjectTrackingConfig(properties); + }; + + /** + * Encodes the specified StreamingObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig} message StreamingObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingObjectTrackingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StreamingObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingObjectTrackingConfig} message StreamingObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingObjectTrackingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingObjectTrackingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig} StreamingObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingObjectTrackingConfig.decode = function 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.videointelligence.v1p3beta1.StreamingObjectTrackingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig} StreamingObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingObjectTrackingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingObjectTrackingConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingObjectTrackingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StreamingObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig} StreamingObjectTrackingConfig + */ + StreamingObjectTrackingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig) + return object; + return new $root.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig(); + }; + + /** + * Creates a plain object from a StreamingObjectTrackingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig} message StreamingObjectTrackingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingObjectTrackingConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StreamingObjectTrackingConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingObjectTrackingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingObjectTrackingConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingObjectTrackingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig"; + }; + + return StreamingObjectTrackingConfig; + })(); + + v1p3beta1.StreamingAutomlActionRecognitionConfig = (function() { + + /** + * Properties of a StreamingAutomlActionRecognitionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingAutomlActionRecognitionConfig + * @property {string|null} [modelName] StreamingAutomlActionRecognitionConfig modelName + */ + + /** + * Constructs a new StreamingAutomlActionRecognitionConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingAutomlActionRecognitionConfig. + * @implements IStreamingAutomlActionRecognitionConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig=} [properties] Properties to set + */ + function StreamingAutomlActionRecognitionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAutomlActionRecognitionConfig modelName. + * @member {string} modelName + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @instance + */ + StreamingAutomlActionRecognitionConfig.prototype.modelName = ""; + + /** + * Creates a new StreamingAutomlActionRecognitionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig} StreamingAutomlActionRecognitionConfig instance + */ + StreamingAutomlActionRecognitionConfig.create = function create(properties) { + return new StreamingAutomlActionRecognitionConfig(properties); + }; + + /** + * Encodes the specified StreamingAutomlActionRecognitionConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig} message StreamingAutomlActionRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAutomlActionRecognitionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelName != null && Object.hasOwnProperty.call(message, "modelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelName); + return writer; + }; + + /** + * Encodes the specified StreamingAutomlActionRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlActionRecognitionConfig} message StreamingAutomlActionRecognitionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAutomlActionRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAutomlActionRecognitionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig} StreamingAutomlActionRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAutomlActionRecognitionConfig.decode = function 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.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAutomlActionRecognitionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig} StreamingAutomlActionRecognitionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAutomlActionRecognitionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAutomlActionRecognitionConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAutomlActionRecognitionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelName != null && message.hasOwnProperty("modelName")) + if (!$util.isString(message.modelName)) + return "modelName: string expected"; + return null; + }; + + /** + * Creates a StreamingAutomlActionRecognitionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig} StreamingAutomlActionRecognitionConfig + */ + StreamingAutomlActionRecognitionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig(); + if (object.modelName != null) + message.modelName = String(object.modelName); + return message; + }; + + /** + * Creates a plain object from a StreamingAutomlActionRecognitionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig} message StreamingAutomlActionRecognitionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAutomlActionRecognitionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelName = ""; + if (message.modelName != null && message.hasOwnProperty("modelName")) + object.modelName = message.modelName; + return object; + }; + + /** + * Converts this StreamingAutomlActionRecognitionConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingAutomlActionRecognitionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingAutomlActionRecognitionConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingAutomlActionRecognitionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingAutomlActionRecognitionConfig"; + }; + + return StreamingAutomlActionRecognitionConfig; + })(); + + v1p3beta1.StreamingAutomlClassificationConfig = (function() { + + /** + * Properties of a StreamingAutomlClassificationConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingAutomlClassificationConfig + * @property {string|null} [modelName] StreamingAutomlClassificationConfig modelName + */ + + /** + * Constructs a new StreamingAutomlClassificationConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingAutomlClassificationConfig. + * @implements IStreamingAutomlClassificationConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig=} [properties] Properties to set + */ + function StreamingAutomlClassificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAutomlClassificationConfig modelName. + * @member {string} modelName + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @instance + */ + StreamingAutomlClassificationConfig.prototype.modelName = ""; + + /** + * Creates a new StreamingAutomlClassificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig} StreamingAutomlClassificationConfig instance + */ + StreamingAutomlClassificationConfig.create = function create(properties) { + return new StreamingAutomlClassificationConfig(properties); + }; + + /** + * Encodes the specified StreamingAutomlClassificationConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig} message StreamingAutomlClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAutomlClassificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelName != null && Object.hasOwnProperty.call(message, "modelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelName); + return writer; + }; + + /** + * Encodes the specified StreamingAutomlClassificationConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlClassificationConfig} message StreamingAutomlClassificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAutomlClassificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAutomlClassificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig} StreamingAutomlClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAutomlClassificationConfig.decode = function 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.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAutomlClassificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig} StreamingAutomlClassificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAutomlClassificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAutomlClassificationConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAutomlClassificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelName != null && message.hasOwnProperty("modelName")) + if (!$util.isString(message.modelName)) + return "modelName: string expected"; + return null; + }; + + /** + * Creates a StreamingAutomlClassificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig} StreamingAutomlClassificationConfig + */ + StreamingAutomlClassificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig(); + if (object.modelName != null) + message.modelName = String(object.modelName); + return message; + }; + + /** + * Creates a plain object from a StreamingAutomlClassificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig} message StreamingAutomlClassificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAutomlClassificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelName = ""; + if (message.modelName != null && message.hasOwnProperty("modelName")) + object.modelName = message.modelName; + return object; + }; + + /** + * Converts this StreamingAutomlClassificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingAutomlClassificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingAutomlClassificationConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingAutomlClassificationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig"; + }; + + return StreamingAutomlClassificationConfig; + })(); + + v1p3beta1.StreamingAutomlObjectTrackingConfig = (function() { + + /** + * Properties of a StreamingAutomlObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingAutomlObjectTrackingConfig + * @property {string|null} [modelName] StreamingAutomlObjectTrackingConfig modelName + */ + + /** + * Constructs a new StreamingAutomlObjectTrackingConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingAutomlObjectTrackingConfig. + * @implements IStreamingAutomlObjectTrackingConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig=} [properties] Properties to set + */ + function StreamingAutomlObjectTrackingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAutomlObjectTrackingConfig modelName. + * @member {string} modelName + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @instance + */ + StreamingAutomlObjectTrackingConfig.prototype.modelName = ""; + + /** + * Creates a new StreamingAutomlObjectTrackingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig} StreamingAutomlObjectTrackingConfig instance + */ + StreamingAutomlObjectTrackingConfig.create = function create(properties) { + return new StreamingAutomlObjectTrackingConfig(properties); + }; + + /** + * Encodes the specified StreamingAutomlObjectTrackingConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig} message StreamingAutomlObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAutomlObjectTrackingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelName != null && Object.hasOwnProperty.call(message, "modelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelName); + return writer; + }; + + /** + * Encodes the specified StreamingAutomlObjectTrackingConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingAutomlObjectTrackingConfig} message StreamingAutomlObjectTrackingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAutomlObjectTrackingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAutomlObjectTrackingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig} StreamingAutomlObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAutomlObjectTrackingConfig.decode = function 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.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAutomlObjectTrackingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig} StreamingAutomlObjectTrackingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAutomlObjectTrackingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAutomlObjectTrackingConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAutomlObjectTrackingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelName != null && message.hasOwnProperty("modelName")) + if (!$util.isString(message.modelName)) + return "modelName: string expected"; + return null; + }; + + /** + * Creates a StreamingAutomlObjectTrackingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig} StreamingAutomlObjectTrackingConfig + */ + StreamingAutomlObjectTrackingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig(); + if (object.modelName != null) + message.modelName = String(object.modelName); + return message; + }; + + /** + * Creates a plain object from a StreamingAutomlObjectTrackingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig} message StreamingAutomlObjectTrackingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAutomlObjectTrackingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelName = ""; + if (message.modelName != null && message.hasOwnProperty("modelName")) + object.modelName = message.modelName; + return object; + }; + + /** + * Converts this StreamingAutomlObjectTrackingConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingAutomlObjectTrackingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingAutomlObjectTrackingConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingAutomlObjectTrackingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig"; + }; + + return StreamingAutomlObjectTrackingConfig; + })(); + + v1p3beta1.StreamingStorageConfig = (function() { + + /** + * Properties of a StreamingStorageConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @interface IStreamingStorageConfig + * @property {boolean|null} [enableStorageAnnotationResult] StreamingStorageConfig enableStorageAnnotationResult + * @property {string|null} [annotationResultStorageDirectory] StreamingStorageConfig annotationResultStorageDirectory + */ + + /** + * Constructs a new StreamingStorageConfig. + * @memberof google.cloud.videointelligence.v1p3beta1 + * @classdesc Represents a StreamingStorageConfig. + * @implements IStreamingStorageConfig + * @constructor + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig=} [properties] Properties to set + */ + function StreamingStorageConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingStorageConfig enableStorageAnnotationResult. + * @member {boolean} enableStorageAnnotationResult + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @instance + */ + StreamingStorageConfig.prototype.enableStorageAnnotationResult = false; + + /** + * StreamingStorageConfig annotationResultStorageDirectory. + * @member {string} annotationResultStorageDirectory + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @instance + */ + StreamingStorageConfig.prototype.annotationResultStorageDirectory = ""; + + /** + * Creates a new StreamingStorageConfig instance using the specified properties. + * @function create + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig=} [properties] Properties to set + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig} StreamingStorageConfig instance + */ + StreamingStorageConfig.create = function create(properties) { + return new StreamingStorageConfig(properties); + }; + + /** + * Encodes the specified StreamingStorageConfig message. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig} message StreamingStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingStorageConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableStorageAnnotationResult != null && Object.hasOwnProperty.call(message, "enableStorageAnnotationResult")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableStorageAnnotationResult); + if (message.annotationResultStorageDirectory != null && Object.hasOwnProperty.call(message, "annotationResultStorageDirectory")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.annotationResultStorageDirectory); + return writer; + }; + + /** + * Encodes the specified StreamingStorageConfig message, length delimited. Does not implicitly {@link google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.IStreamingStorageConfig} message StreamingStorageConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingStorageConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingStorageConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig} StreamingStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingStorageConfig.decode = function 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.videointelligence.v1p3beta1.StreamingStorageConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableStorageAnnotationResult = reader.bool(); + break; + } + case 3: { + message.annotationResultStorageDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingStorageConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig} StreamingStorageConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingStorageConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingStorageConfig message. + * @function verify + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingStorageConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableStorageAnnotationResult != null && message.hasOwnProperty("enableStorageAnnotationResult")) + if (typeof message.enableStorageAnnotationResult !== "boolean") + return "enableStorageAnnotationResult: boolean expected"; + if (message.annotationResultStorageDirectory != null && message.hasOwnProperty("annotationResultStorageDirectory")) + if (!$util.isString(message.annotationResultStorageDirectory)) + return "annotationResultStorageDirectory: string expected"; + return null; + }; + + /** + * Creates a StreamingStorageConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig} StreamingStorageConfig + */ + StreamingStorageConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig) + return object; + var message = new $root.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig(); + if (object.enableStorageAnnotationResult != null) + message.enableStorageAnnotationResult = Boolean(object.enableStorageAnnotationResult); + if (object.annotationResultStorageDirectory != null) + message.annotationResultStorageDirectory = String(object.annotationResultStorageDirectory); + return message; + }; + + /** + * Creates a plain object from a StreamingStorageConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig} message StreamingStorageConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingStorageConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableStorageAnnotationResult = false; + object.annotationResultStorageDirectory = ""; + } + if (message.enableStorageAnnotationResult != null && message.hasOwnProperty("enableStorageAnnotationResult")) + object.enableStorageAnnotationResult = message.enableStorageAnnotationResult; + if (message.annotationResultStorageDirectory != null && message.hasOwnProperty("annotationResultStorageDirectory")) + object.annotationResultStorageDirectory = message.annotationResultStorageDirectory; + return object; + }; + + /** + * Converts this StreamingStorageConfig to JSON. + * @function toJSON + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingStorageConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingStorageConfig + * @function getTypeUrl + * @memberof google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingStorageConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig"; + }; + + return StreamingStorageConfig; + })(); + + return v1p3beta1; + })(); + + return videointelligence; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-videointelligence/protos/protos.json b/packages/google-cloud-videointelligence/protos/protos.json new file mode 100644 index 00000000000..4132bfd3f87 --- /dev/null +++ b/packages/google-cloud-videointelligence/protos/protos.json @@ -0,0 +1,4810 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "videointelligence": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1" + }, + "nested": { + "VideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/videos:annotate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "input_uri,features", + "(google.longrunning.operation_info).response_type": "AnnotateVideoResponse", + "(google.longrunning.operation_info).metadata_type": "AnnotateVideoProgress" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/videos:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "input_uri,features" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotateVideoResponse", + "metadata_type": "AnnotateVideoProgress" + } + } + ] + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locationId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "faceDetectionConfig": { + "type": "FaceDetectionConfig", + "id": 5 + }, + "speechTranscriptionConfig": { + "type": "SpeechTranscriptionConfig", + "id": 6 + }, + "textDetectionConfig": { + "type": "TextDetectionConfig", + "id": 8 + }, + "personDetectionConfig": { + "type": "PersonDetectionConfig", + "id": 11 + }, + "objectTrackingConfig": { + "type": "ObjectTrackingConfig", + "id": 13 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4, + "SPEECH_TRANSCRIPTION": 6, + "TEXT_DETECTION": 7, + "OBJECT_TRACKING": 9, + "LOGO_RECOGNITION": 12, + "PERSON_DETECTION": 14 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "frameConfidenceThreshold": { + "type": "float", + "id": 4 + }, + "videoConfidenceThreshold": { + "type": "float", + "id": 5 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ObjectTrackingConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "FaceDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "includeBoundingBoxes": { + "type": "bool", + "id": 2 + }, + "includeAttributes": { + "type": "bool", + "id": 5 + } + } + }, + "PersonDetectionConfig": { + "fields": { + "includeBoundingBoxes": { + "type": "bool", + "id": 1 + }, + "includePoseLandmarks": { + "type": "bool", + "id": 2 + }, + "includeAttributes": { + "type": "bool", + "id": 3 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "TextDetectionConfig": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + }, + "version": { + "type": "string", + "id": 5 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "FaceDetectionAnnotation": { + "fields": { + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 3 + }, + "thumbnail": { + "type": "bytes", + "id": 4 + }, + "version": { + "type": "string", + "id": 5 + } + } + }, + "PersonDetectionAnnotation": { + "fields": { + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "FaceSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + } + } + }, + "FaceFrame": { + "options": { + "deprecated": true + }, + "fields": { + "normalizedBoundingBoxes": { + "rule": "repeated", + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "FaceAnnotation": { + "options": { + "deprecated": true + }, + "fields": { + "thumbnail": { + "type": "bytes", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "FaceSegment", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "FaceFrame", + "id": 3 + } + } + }, + "TimestampedObject": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "attributes": { + "rule": "repeated", + "type": "DetectedAttribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "landmarks": { + "rule": "repeated", + "type": "DetectedLandmark", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Track": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "timestampedObjects": { + "rule": "repeated", + "type": "TimestampedObject", + "id": 2 + }, + "attributes": { + "rule": "repeated", + "type": "DetectedAttribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confidence": { + "type": "float", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectedAttribute": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "value": { + "type": "string", + "id": 3 + } + } + }, + "DetectedLandmark": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "point": { + "type": "NormalizedVertex", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 3 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segment": { + "type": "VideoSegment", + "id": 10 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "segmentPresenceLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 23 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "shotPresenceLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 24 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 5, + "options": { + "deprecated": true + } + }, + "faceDetectionAnnotations": { + "rule": "repeated", + "type": "FaceDetectionAnnotation", + "id": 13 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "speechTranscriptions": { + "rule": "repeated", + "type": "SpeechTranscription", + "id": 11 + }, + "textAnnotations": { + "rule": "repeated", + "type": "TextAnnotation", + "id": 12 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 14 + }, + "logoRecognitionAnnotations": { + "rule": "repeated", + "type": "LogoRecognitionAnnotation", + "id": 19 + }, + "personDetectionAnnotations": { + "rule": "repeated", + "type": "PersonDetectionAnnotation", + "id": 20 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "feature": { + "type": "Feature", + "id": 5 + }, + "segment": { + "type": "VideoSegment", + "id": 6 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "SpeechTranscriptionConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxAlternatives": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterProfanity": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioTracks": { + "rule": "repeated", + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableSpeakerDiarization": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diarizationSpeakerCount": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableWordConfidence": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechTranscription": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "TextFrame", + "id": 3 + } + } + }, + "TextFrame": { + "fields": { + "rotatedBoundingBox": { + "type": "NormalizedBoundingPoly", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "TextAnnotation": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "TextSegment", + "id": 2 + }, + "version": { + "type": "string", + "id": 3 + } + } + }, + "ObjectTrackingFrame": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ObjectTrackingAnnotation": { + "oneofs": { + "trackInfo": { + "oneof": [ + "segment", + "trackId" + ] + } + }, + "fields": { + "segment": { + "type": "VideoSegment", + "id": 3 + }, + "trackId": { + "type": "int64", + "id": 5 + }, + "entity": { + "type": "Entity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "frames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 2 + }, + "version": { + "type": "string", + "id": 6 + } + } + }, + "LogoRecognitionAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 3 + } + } + } + } + }, + "v1beta2": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1Beta2", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1beta2", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1beta2", + "ruby_package": "Google::Cloud::VideoIntelligence::V1beta2" + }, + "nested": { + "VideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/videos:annotate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "input_uri,features", + "(google.longrunning.operation_info).response_type": "AnnotateVideoResponse", + "(google.longrunning.operation_info).metadata_type": "AnnotateVideoProgress" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/videos:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "input_uri,features" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotateVideoResponse", + "metadata_type": "AnnotateVideoProgress" + } + } + ] + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locationId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "faceDetectionConfig": { + "type": "FaceDetectionConfig", + "id": 5 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "FaceDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "includeBoundingBoxes": { + "type": "bool", + "id": 2 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "FaceSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + } + } + }, + "FaceFrame": { + "fields": { + "normalizedBoundingBoxes": { + "rule": "repeated", + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "thumbnail": { + "type": "bytes", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "FaceSegment", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "FaceFrame", + "id": 3 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 5 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p1beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1p1beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1p1beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1p1beta1" + }, + "nested": { + "VideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p1beta1/videos:annotate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "input_uri,features", + "(google.longrunning.operation_info).response_type": "AnnotateVideoResponse", + "(google.longrunning.operation_info).metadata_type": "AnnotateVideoProgress" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p1beta1/videos:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "input_uri,features" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotateVideoResponse", + "metadata_type": "AnnotateVideoProgress" + } + } + ] + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locationId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "speechTranscriptionConfig": { + "type": "SpeechTranscriptionConfig", + "id": 6 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "speechTranscriptions": { + "rule": "repeated", + "type": "SpeechTranscription", + "id": 11 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "SpeechTranscriptionConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxAlternatives": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterProfanity": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioTracks": { + "rule": "repeated", + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechTranscription": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "SPEECH_TRANSCRIPTION": 6 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1p2beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1P2Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1p2beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1p2beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1p2beta1" + }, + "nested": { + "VideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p2beta1/videos:annotate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "input_uri,features", + "(google.longrunning.operation_info).response_type": "AnnotateVideoResponse", + "(google.longrunning.operation_info).metadata_type": "AnnotateVideoProgress" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p2beta1/videos:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "input_uri,features" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotateVideoResponse", + "metadata_type": "AnnotateVideoProgress" + } + } + ] + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locationId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "textDetectionConfig": { + "type": "TextDetectionConfig", + "id": 8 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "TextDetectionConfig": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "textAnnotations": { + "rule": "repeated", + "type": "TextAnnotation", + "id": 12 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 14 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "TextFrame", + "id": 3 + } + } + }, + "TextFrame": { + "fields": { + "rotatedBoundingBox": { + "type": "NormalizedBoundingPoly", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "TextAnnotation": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "TextSegment", + "id": 2 + } + } + }, + "ObjectTrackingFrame": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ObjectTrackingAnnotation": { + "oneofs": { + "trackInfo": { + "oneof": [ + "segment", + "trackId" + ] + } + }, + "fields": { + "segment": { + "type": "VideoSegment", + "id": 3 + }, + "trackId": { + "type": "int64", + "id": 5 + }, + "entity": { + "type": "Entity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "frames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 2 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "TEXT_DETECTION": 7, + "OBJECT_TRACKING": 9 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1p3beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1P3Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p3beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1p3beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1p3beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1p3beta1" + }, + "nested": { + "VideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p3beta1/videos:annotate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "input_uri,features", + "(google.longrunning.operation_info).response_type": "AnnotateVideoResponse", + "(google.longrunning.operation_info).metadata_type": "AnnotateVideoProgress" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p3beta1/videos:annotate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "input_uri,features" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AnnotateVideoResponse", + "metadata_type": "AnnotateVideoProgress" + } + } + ] + } + } + }, + "StreamingVideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "StreamingAnnotateVideo": { + "requestType": "StreamingAnnotateVideoRequest", + "requestStream": true, + "responseType": "StreamingAnnotateVideoResponse", + "responseStream": true + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locationId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "faceDetectionConfig": { + "type": "FaceDetectionConfig", + "id": 5 + }, + "speechTranscriptionConfig": { + "type": "SpeechTranscriptionConfig", + "id": 6 + }, + "textDetectionConfig": { + "type": "TextDetectionConfig", + "id": 8 + }, + "personDetectionConfig": { + "type": "PersonDetectionConfig", + "id": 11 + }, + "objectTrackingConfig": { + "type": "ObjectTrackingConfig", + "id": 13 + } + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "frameConfidenceThreshold": { + "type": "float", + "id": 4 + }, + "videoConfidenceThreshold": { + "type": "float", + "id": 5 + } + } + }, + "StreamingFeature": { + "values": { + "STREAMING_FEATURE_UNSPECIFIED": 0, + "STREAMING_LABEL_DETECTION": 1, + "STREAMING_SHOT_CHANGE_DETECTION": 2, + "STREAMING_EXPLICIT_CONTENT_DETECTION": 3, + "STREAMING_OBJECT_TRACKING": 4, + "STREAMING_AUTOML_ACTION_RECOGNITION": 23, + "STREAMING_AUTOML_CLASSIFICATION": 21, + "STREAMING_AUTOML_OBJECT_TRACKING": 22 + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4, + "SPEECH_TRANSCRIPTION": 6, + "TEXT_DETECTION": 7, + "OBJECT_TRACKING": 9, + "LOGO_RECOGNITION": 12, + "CELEBRITY_RECOGNITION": 13, + "PERSON_DETECTION": 14 + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ObjectTrackingConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "FaceDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "includeBoundingBoxes": { + "type": "bool", + "id": 2 + }, + "includeAttributes": { + "type": "bool", + "id": 5 + } + } + }, + "PersonDetectionConfig": { + "fields": { + "includeBoundingBoxes": { + "type": "bool", + "id": 1 + }, + "includePoseLandmarks": { + "type": "bool", + "id": 2 + }, + "includeAttributes": { + "type": "bool", + "id": 3 + } + } + }, + "TextDetectionConfig": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "TimestampedObject": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "attributes": { + "rule": "repeated", + "type": "DetectedAttribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "landmarks": { + "rule": "repeated", + "type": "DetectedLandmark", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Track": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "timestampedObjects": { + "rule": "repeated", + "type": "TimestampedObject", + "id": 2 + }, + "attributes": { + "rule": "repeated", + "type": "DetectedAttribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confidence": { + "type": "float", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DetectedAttribute": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "value": { + "type": "string", + "id": 3 + } + } + }, + "Celebrity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + }, + "CelebrityTrack": { + "fields": { + "celebrities": { + "rule": "repeated", + "type": "RecognizedCelebrity", + "id": 1 + }, + "faceTrack": { + "type": "Track", + "id": 3 + } + }, + "nested": { + "RecognizedCelebrity": { + "fields": { + "celebrity": { + "type": "Celebrity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + } + } + }, + "CelebrityRecognitionAnnotation": { + "fields": { + "celebrityTracks": { + "rule": "repeated", + "type": "CelebrityTrack", + "id": 1 + } + } + }, + "DetectedLandmark": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "point": { + "type": "NormalizedVertex", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 3 + } + } + }, + "FaceDetectionAnnotation": { + "fields": { + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 3 + }, + "thumbnail": { + "type": "bytes", + "id": 4 + } + } + }, + "PersonDetectionAnnotation": { + "fields": { + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 1 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segment": { + "type": "VideoSegment", + "id": 10 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "segmentPresenceLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 23 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "shotPresenceLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 24 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "faceDetectionAnnotations": { + "rule": "repeated", + "type": "FaceDetectionAnnotation", + "id": 13 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "speechTranscriptions": { + "rule": "repeated", + "type": "SpeechTranscription", + "id": 11 + }, + "textAnnotations": { + "rule": "repeated", + "type": "TextAnnotation", + "id": 12 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 14 + }, + "logoRecognitionAnnotations": { + "rule": "repeated", + "type": "LogoRecognitionAnnotation", + "id": 19 + }, + "personDetectionAnnotations": { + "rule": "repeated", + "type": "PersonDetectionAnnotation", + "id": 20 + }, + "celebrityRecognitionAnnotations": { + "type": "CelebrityRecognitionAnnotation", + "id": 21 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "feature": { + "type": "Feature", + "id": 5 + }, + "segment": { + "type": "VideoSegment", + "id": 6 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "SpeechTranscriptionConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxAlternatives": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filterProfanity": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "audioTracks": { + "rule": "repeated", + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableSpeakerDiarization": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diarizationSpeakerCount": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableWordConfidence": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SpeechTranscription": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speakerTag": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "TextFrame", + "id": 3 + } + } + }, + "TextFrame": { + "fields": { + "rotatedBoundingBox": { + "type": "NormalizedBoundingPoly", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "TextAnnotation": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "TextSegment", + "id": 2 + } + } + }, + "ObjectTrackingFrame": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ObjectTrackingAnnotation": { + "oneofs": { + "trackInfo": { + "oneof": [ + "segment", + "trackId" + ] + } + }, + "fields": { + "segment": { + "type": "VideoSegment", + "id": 3 + }, + "trackId": { + "type": "int64", + "id": 5 + }, + "entity": { + "type": "Entity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "frames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 2 + } + } + }, + "LogoRecognitionAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 3 + } + } + }, + "StreamingAnnotateVideoRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "videoConfig", + "inputContent" + ] + } + }, + "fields": { + "videoConfig": { + "type": "StreamingVideoConfig", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingVideoConfig": { + "oneofs": { + "streamingConfig": { + "oneof": [ + "shotChangeDetectionConfig", + "labelDetectionConfig", + "explicitContentDetectionConfig", + "objectTrackingConfig", + "automlActionRecognitionConfig", + "automlClassificationConfig", + "automlObjectTrackingConfig" + ] + } + }, + "fields": { + "shotChangeDetectionConfig": { + "type": "StreamingShotChangeDetectionConfig", + "id": 2 + }, + "labelDetectionConfig": { + "type": "StreamingLabelDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "StreamingExplicitContentDetectionConfig", + "id": 4 + }, + "objectTrackingConfig": { + "type": "StreamingObjectTrackingConfig", + "id": 5 + }, + "automlActionRecognitionConfig": { + "type": "StreamingAutomlActionRecognitionConfig", + "id": 23 + }, + "automlClassificationConfig": { + "type": "StreamingAutomlClassificationConfig", + "id": 21 + }, + "automlObjectTrackingConfig": { + "type": "StreamingAutomlObjectTrackingConfig", + "id": 22 + }, + "feature": { + "type": "StreamingFeature", + "id": 1 + }, + "storageConfig": { + "type": "StreamingStorageConfig", + "id": 30 + } + } + }, + "StreamingAnnotateVideoResponse": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1 + }, + "annotationResults": { + "type": "StreamingVideoAnnotationResults", + "id": 2 + }, + "annotationResultsUri": { + "type": "string", + "id": 3 + } + } + }, + "StreamingVideoAnnotationResults": { + "fields": { + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 3 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 4 + } + } + }, + "StreamingShotChangeDetectionConfig": { + "fields": {} + }, + "StreamingLabelDetectionConfig": { + "fields": { + "stationaryCamera": { + "type": "bool", + "id": 1 + } + } + }, + "StreamingExplicitContentDetectionConfig": { + "fields": {} + }, + "StreamingObjectTrackingConfig": { + "fields": {} + }, + "StreamingAutomlActionRecognitionConfig": { + "fields": { + "modelName": { + "type": "string", + "id": 1 + } + } + }, + "StreamingAutomlClassificationConfig": { + "fields": { + "modelName": { + "type": "string", + "id": 1 + } + } + }, + "StreamingAutomlObjectTrackingConfig": { + "fields": { + "modelName": { + "type": "string", + "id": 1 + } + } + }, + "StreamingStorageConfig": { + "fields": { + "enableStorageAnnotationResult": { + "type": "bool", + "id": 1 + }, + "annotationResultStorageDirectory": { + "type": "string", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/samples/.eslintrc.yml b/packages/google-cloud-videointelligence/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-videointelligence/samples/README.md b/packages/google-cloud-videointelligence/samples/README.md new file mode 100644 index 00000000000..c4a5f850027 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/README.md @@ -0,0 +1,176 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Video Intelligence: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Video_intelligence_service.annotate_video](#video_intelligence_service.annotate_video) + * [Video_intelligence_service.annotate_video](#video_intelligence_service.annotate_video) + * [Video_intelligence_service.annotate_video](#video_intelligence_service.annotate_video) + * [Video_intelligence_service.annotate_video](#video_intelligence_service.annotate_video) + * [Streaming_video_intelligence_service.streaming_annotate_video](#streaming_video_intelligence_service.streaming_annotate_video) + * [Video_intelligence_service.annotate_video](#video_intelligence_service.annotate_video) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Video_intelligence_service.annotate_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js` + + +----- + + + + +### Video_intelligence_service.annotate_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js` + + +----- + + + + +### Video_intelligence_service.annotate_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js` + + +----- + + + + +### Video_intelligence_service.annotate_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js` + + +----- + + + + +### Streaming_video_intelligence_service.streaming_annotate_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js` + + +----- + + + + +### Video_intelligence_service.annotate_video + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/quickstart.js` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-videointelligence/samples/test/quickstart.test.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-videointelligence/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-videointelligence/samples/test/quickstart.test.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/video-intelligence diff --git a/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json b/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json new file mode 100644 index 00000000000..2f11da8f205 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1/snippet_metadata.google.cloud.videointelligence.v1.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-videointelligence", + "version": "4.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.videointelligence.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_async", + "title": "videointelligence annotateVideo Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results).", + "canonical": true, + "file": "video_intelligence_service.annotate_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1.VideoIntelligenceService.AnnotateVideo", + "async": true, + "parameters": [ + { + "name": "input_uri", + "type": "TYPE_STRING" + }, + { + "name": "input_content", + "type": "TYPE_BYTES" + }, + { + "name": "features", + "type": "TYPE_ENUM[]" + }, + { + "name": "video_context", + "type": ".google.cloud.videointelligence.v1.VideoContext" + }, + { + "name": "output_uri", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoIntelligenceServiceClient", + "fullName": "google.cloud.videointelligence.v1.VideoIntelligenceServiceClient" + }, + "method": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1.VideoIntelligenceService.AnnotateVideo", + "service": { + "shortName": "VideoIntelligenceService", + "fullName": "google.cloud.videointelligence.v1.VideoIntelligenceService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js b/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js new file mode 100644 index 00000000000..5200ada4755 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1/video_intelligence_service.annotate_video.js @@ -0,0 +1,103 @@ +// 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(features) { + // [START videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_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. + */ + /** + * Input video location. Currently, only + * Cloud Storage (https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + */ + // const inputUri = 'abc123' + /** + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + */ + // const inputContent = 'Buffer.from('string')' + /** + * Required. Requested video annotation features. + */ + // const features = 1234 + /** + * Additional video context and/or feature-specific parameters. + */ + // const videoContext = {} + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only Cloud Storage (https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). + */ + // const outputUri = 'abc123' + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + */ + // const locationId = 'abc123' + + // Imports the Videointelligence library + const {VideoIntelligenceServiceClient} = require('@google-cloud/video-intelligence').v1; + + // Instantiates a client + const videointelligenceClient = new VideoIntelligenceServiceClient(); + + async function callAnnotateVideo() { + // Construct request + const request = { + features, + }; + + // Run request + const [operation] = await videointelligenceClient.annotateVideo(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAnnotateVideo(); + // [END videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json b/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json new file mode 100644 index 00000000000..7960b4e4882 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1beta2/snippet_metadata.google.cloud.videointelligence.v1beta2.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-videointelligence", + "version": "4.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.videointelligence.v1beta2", + "version": "v1beta2" + } + ] + }, + "snippets": [ + { + "regionTag": "videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_async", + "title": "videointelligence annotateVideo Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results).", + "canonical": true, + "file": "video_intelligence_service.annotate_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1beta2.VideoIntelligenceService.AnnotateVideo", + "async": true, + "parameters": [ + { + "name": "input_uri", + "type": "TYPE_STRING" + }, + { + "name": "input_content", + "type": "TYPE_BYTES" + }, + { + "name": "features", + "type": "TYPE_ENUM[]" + }, + { + "name": "video_context", + "type": ".google.cloud.videointelligence.v1beta2.VideoContext" + }, + { + "name": "output_uri", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoIntelligenceServiceClient", + "fullName": "google.cloud.videointelligence.v1beta2.VideoIntelligenceServiceClient" + }, + "method": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1beta2.VideoIntelligenceService.AnnotateVideo", + "service": { + "shortName": "VideoIntelligenceService", + "fullName": "google.cloud.videointelligence.v1beta2.VideoIntelligenceService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js b/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js new file mode 100644 index 00000000000..505d4d0ccb9 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1beta2/video_intelligence_service.annotate_video.js @@ -0,0 +1,102 @@ +// 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(features) { + // [START videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_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. + */ + /** + * Input video location. Currently, only + * Google Cloud Storage (https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + */ + // const inputUri = 'abc123' + /** + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + */ + // const inputContent = 'Buffer.from('string')' + /** + * Required. Requested video annotation features. + */ + // const features = 1234 + /** + * Additional video context and/or feature-specific parameters. + */ + // const videoContext = {} + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only Google Cloud Storage (https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). + */ + // const outputUri = 'abc123' + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + */ + // const locationId = 'abc123' + + // Imports the Videointelligence library + const {VideoIntelligenceServiceClient} = require('@google-cloud/video-intelligence').v1beta2; + + // Instantiates a client + const videointelligenceClient = new VideoIntelligenceServiceClient(); + + async function callAnnotateVideo() { + // Construct request + const request = { + features, + }; + + // Run request + const [operation] = await videointelligenceClient.annotateVideo(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAnnotateVideo(); + // [END videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json b/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json new file mode 100644 index 00000000000..7c582e7259a --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/snippet_metadata.google.cloud.videointelligence.v1p1beta1.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-videointelligence", + "version": "4.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.videointelligence.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_async", + "title": "videointelligence annotateVideo Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results).", + "canonical": true, + "file": "video_intelligence_service.annotate_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService.AnnotateVideo", + "async": true, + "parameters": [ + { + "name": "input_uri", + "type": "TYPE_STRING" + }, + { + "name": "input_content", + "type": "TYPE_BYTES" + }, + { + "name": "features", + "type": "TYPE_ENUM[]" + }, + { + "name": "video_context", + "type": ".google.cloud.videointelligence.v1p1beta1.VideoContext" + }, + { + "name": "output_uri", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoIntelligenceServiceClient", + "fullName": "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient" + }, + "method": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService.AnnotateVideo", + "service": { + "shortName": "VideoIntelligenceService", + "fullName": "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js b/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js new file mode 100644 index 00000000000..afa38678ddd --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js @@ -0,0 +1,102 @@ +// 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(features) { + // [START videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_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. + */ + /** + * Input video location. Currently, only + * Google Cloud Storage (https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + */ + // const inputUri = 'abc123' + /** + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + */ + // const inputContent = 'Buffer.from('string')' + /** + * Required. Requested video annotation features. + */ + // const features = 1234 + /** + * Additional video context and/or feature-specific parameters. + */ + // const videoContext = {} + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only Google Cloud Storage (https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). + */ + // const outputUri = 'abc123' + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + */ + // const locationId = 'abc123' + + // Imports the Videointelligence library + const {VideoIntelligenceServiceClient} = require('@google-cloud/video-intelligence').v1p1beta1; + + // Instantiates a client + const videointelligenceClient = new VideoIntelligenceServiceClient(); + + async function callAnnotateVideo() { + // Construct request + const request = { + features, + }; + + // Run request + const [operation] = await videointelligenceClient.annotateVideo(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAnnotateVideo(); + // [END videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json b/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json new file mode 100644 index 00000000000..560382e2f13 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/snippet_metadata.google.cloud.videointelligence.v1p2beta1.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-videointelligence", + "version": "4.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.videointelligence.v1p2beta1", + "version": "v1p2beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_async", + "title": "videointelligence annotateVideo Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results).", + "canonical": true, + "file": "video_intelligence_service.annotate_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService.AnnotateVideo", + "async": true, + "parameters": [ + { + "name": "input_uri", + "type": "TYPE_STRING" + }, + { + "name": "input_content", + "type": "TYPE_BYTES" + }, + { + "name": "features", + "type": "TYPE_ENUM[]" + }, + { + "name": "video_context", + "type": ".google.cloud.videointelligence.v1p2beta1.VideoContext" + }, + { + "name": "output_uri", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoIntelligenceServiceClient", + "fullName": "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceClient" + }, + "method": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService.AnnotateVideo", + "service": { + "shortName": "VideoIntelligenceService", + "fullName": "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js b/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js new file mode 100644 index 00000000000..5f47ef9b8a0 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js @@ -0,0 +1,100 @@ +// 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(features) { + // [START videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_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. + */ + /** + * Input video location. Currently, only + * Google Cloud Storage (https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For more information, see + * Request URIs (https://cloud.google.com/storage/docs/request-endpoints). + * A video URI may include wildcards in `object-id`, and thus identify + * multiple videos. Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + */ + // const inputUri = 'abc123' + /** + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + */ + // const inputContent = 'Buffer.from('string')' + /** + * Required. Requested video annotation features. + */ + // const features = 1234 + /** + * Additional video context and/or feature-specific parameters. + */ + // const videoContext = {} + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only Google Cloud Storage (https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For more information, see + * Request URIs (https://cloud.google.com/storage/docs/request-endpoints). + */ + // const outputUri = 'abc123' + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + */ + // const locationId = 'abc123' + + // Imports the Videointelligence library + const {VideoIntelligenceServiceClient} = require('@google-cloud/video-intelligence').v1p2beta1; + + // Instantiates a client + const videointelligenceClient = new VideoIntelligenceServiceClient(); + + async function callAnnotateVideo() { + // Construct request + const request = { + features, + }; + + // Run request + const [operation] = await videointelligenceClient.annotateVideo(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAnnotateVideo(); + // [END videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json new file mode 100644 index 00000000000..ecf50893123 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/snippet_metadata.google.cloud.videointelligence.v1p3beta1.json @@ -0,0 +1,119 @@ +{ + "clientLibrary": { + "name": "nodejs-videointelligence", + "version": "4.1.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.videointelligence.v1p3beta1", + "version": "v1p3beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "videointelligence_v1p3beta1_generated_StreamingVideoIntelligenceService_StreamingAnnotateVideo_async", + "title": "videointelligence streamingAnnotateVideo Sample", + "origin": "API_DEFINITION", + "description": " Performs video annotation with bidirectional streaming: emitting results while sending video/audio bytes. This method is only available via the gRPC API (not REST).", + "canonical": true, + "file": "streaming_video_intelligence_service.streaming_annotate_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamingAnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService.StreamingAnnotateVideo", + "async": true, + "parameters": [ + { + "name": "video_config", + "type": ".google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig" + }, + { + "name": "input_content", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse", + "client": { + "shortName": "StreamingVideoIntelligenceServiceClient", + "fullName": "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceServiceClient" + }, + "method": { + "shortName": "StreamingAnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService.StreamingAnnotateVideo", + "service": { + "shortName": "StreamingVideoIntelligenceService", + "fullName": "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService" + } + } + } + }, + { + "regionTag": "videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_async", + "title": "videointelligence annotateVideo Sample", + "origin": "API_DEFINITION", + "description": " Performs asynchronous video annotation. Progress and results can be retrieved through the `google.longrunning.Operations` interface. `Operation.metadata` contains `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` (results).", + "canonical": true, + "file": "video_intelligence_service.annotate_video.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService.AnnotateVideo", + "async": true, + "parameters": [ + { + "name": "input_uri", + "type": "TYPE_STRING" + }, + { + "name": "input_content", + "type": "TYPE_BYTES" + }, + { + "name": "features", + "type": "TYPE_ENUM[]" + }, + { + "name": "video_context", + "type": ".google.cloud.videointelligence.v1p3beta1.VideoContext" + }, + { + "name": "output_uri", + "type": "TYPE_STRING" + }, + { + "name": "location_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VideoIntelligenceServiceClient", + "fullName": "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient" + }, + "method": { + "shortName": "AnnotateVideo", + "fullName": "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService.AnnotateVideo", + "service": { + "shortName": "VideoIntelligenceService", + "fullName": "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js new file mode 100644 index 00000000000..e2460b12efc --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START videointelligence_v1p3beta1_generated_StreamingVideoIntelligenceService_StreamingAnnotateVideo_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. + */ + /** + * Provides information to the annotator, specifing how to process the + * request. The first `AnnotateStreamingVideoRequest` message must only + * contain a `video_config` message. + */ + // const videoConfig = {} + /** + * The video data to be annotated. Chunks of video data are sequentially + * sent in `StreamingAnnotateVideoRequest` messages. Except the initial + * `StreamingAnnotateVideoRequest` message containing only + * `video_config`, all subsequent `AnnotateStreamingVideoRequest` + * messages must only contain `input_content` field. + * Note: as with all bytes fields, protobuffers use a pure binary + * representation (not base64). + */ + // const inputContent = 'Buffer.from('string')' + + // Imports the Videointelligence library + const {StreamingVideoIntelligenceServiceClient} = require('@google-cloud/video-intelligence').v1p3beta1; + + // Instantiates a client + const videointelligenceClient = new StreamingVideoIntelligenceServiceClient(); + + async function callStreamingAnnotateVideo() { + // Construct request + const request = { + }; + + // Run request + const stream = await videointelligenceClient.streamingAnnotateVideo(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callStreamingAnnotateVideo(); + // [END videointelligence_v1p3beta1_generated_StreamingVideoIntelligenceService_StreamingAnnotateVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js new file mode 100644 index 00000000000..8323e6c2768 --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js @@ -0,0 +1,103 @@ +// 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(features) { + // [START videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_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. + */ + /** + * Input video location. Currently, only + * Cloud Storage (https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + */ + // const inputUri = 'abc123' + /** + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + */ + // const inputContent = 'Buffer.from('string')' + /** + * Required. Requested video annotation features. + */ + // const features = 1234 + /** + * Additional video context and/or feature-specific parameters. + */ + // const videoContext = {} + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only Cloud Storage (https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT). For + * more information, see Request + * URIs (https://cloud.google.com/storage/docs/request-endpoints). + */ + // const outputUri = 'abc123' + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + */ + // const locationId = 'abc123' + + // Imports the Videointelligence library + const {VideoIntelligenceServiceClient} = require('@google-cloud/video-intelligence').v1p3beta1; + + // Instantiates a client + const videointelligenceClient = new VideoIntelligenceServiceClient(); + + async function callAnnotateVideo() { + // Construct request + const request = { + features, + }; + + // Run request + const [operation] = await videointelligenceClient.annotateVideo(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAnnotateVideo(); + // [END videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-videointelligence/samples/package.json b/packages/google-cloud-videointelligence/samples/package.json new file mode 100644 index 00000000000..14ccba167bb --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-docs-samples-videointelligence", + "private": true, + "license": "Apache-2.0", + "files": [ + "*.js", + "resources" + ], + "author": "Google Inc.", + "repository": "googleapis/nodejs-video-intelligence", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "test": "mocha test --timeout=800000" + }, + "dependencies": { + "@google-cloud/video-intelligence": "^4.1.1", + "yargs": "^16.0.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-videointelligence/samples/quickstart.js b/packages/google-cloud-videointelligence/samples/quickstart.js new file mode 100644 index 00000000000..92ee050f9fc --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/quickstart.js @@ -0,0 +1,64 @@ +// Copyright 2017 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() { + // [START video_quickstart] + // Imports the Google Cloud Video Intelligence library + const videoIntelligence = require('@google-cloud/video-intelligence'); + + // Creates a client + const client = new videoIntelligence.VideoIntelligenceServiceClient(); + + // The GCS uri of the video to analyze + const gcsUri = 'gs://cloud-samples-data/video/cat.mp4'; + + // Construct request + const request = { + inputUri: gcsUri, + features: ['LABEL_DETECTION'], + }; + + // Execute request + const [operation] = await client.annotateVideo(request); + + console.log( + 'Waiting for operation to complete... (this may take a few minutes)' + ); + + const [operationResult] = await operation.promise(); + + // Gets annotations for video + const annotations = operationResult.annotationResults[0]; + + // Gets labels for video from its annotations + const labels = annotations.segmentLabelAnnotations; + labels.forEach(label => { + console.log(`Label ${label.entity.description} occurs at:`); + label.segments.forEach(segment => { + segment = segment.segment; + console.log( + `\tStart: ${segment.startTimeOffset.seconds}` + + `.${(segment.startTimeOffset.nanos / 1e6).toFixed(0)}s` + ); + console.log( + `\tEnd: ${segment.endTimeOffset.seconds}.` + + `${(segment.endTimeOffset.nanos / 1e6).toFixed(0)}s` + ); + }); + }); + // [END video_quickstart] +} + +main().catch(console.error); diff --git a/packages/google-cloud-videointelligence/samples/test/quickstart.test.js b/packages/google-cloud-videointelligence/samples/test/quickstart.test.js new file mode 100644 index 00000000000..f61913cd49d --- /dev/null +++ b/packages/google-cloud-videointelligence/samples/test/quickstart.test.js @@ -0,0 +1,32 @@ +// Copyright 2017 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('chai'); +const {describe, it} = require('mocha'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cmd = 'node quickstart.js'; +const cwd = path.join(__dirname, '..'); + +describe('quickstart samples', () => { + it('should analyze a hardcoded video', async () => { + const stdout = execSync(cmd, {cwd}); + assert.match(stdout, /medium sized cats/); + }); +}); diff --git a/packages/google-cloud-videointelligence/src/index.ts b/packages/google-cloud-videointelligence/src/index.ts new file mode 100644 index 00000000000..4010eccd976 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/index.ts @@ -0,0 +1,45 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta2 from './v1beta2'; +import * as v1p1beta1 from './v1p1beta1'; +import * as v1p2beta1 from './v1p2beta1'; +import * as v1p3beta1 from './v1p3beta1'; + +const VideoIntelligenceServiceClient = v1.VideoIntelligenceServiceClient; +type VideoIntelligenceServiceClient = v1.VideoIntelligenceServiceClient; + +export { + v1, + v1beta2, + v1p1beta1, + v1p2beta1, + v1p3beta1, + VideoIntelligenceServiceClient, +}; +export default { + v1, + v1beta2, + v1p1beta1, + v1p2beta1, + v1p3beta1, + VideoIntelligenceServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-videointelligence/src/v1/gapic_metadata.json b/packages/google-cloud-videointelligence/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..daf4c17325e --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.videointelligence.v1", + "libraryPackage": "@google-cloud/video-intelligence", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1/index.ts b/packages/google-cloud-videointelligence/src/v1/index.ts new file mode 100644 index 00000000000..6fcd19333aa --- /dev/null +++ b/packages/google-cloud-videointelligence/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 {VideoIntelligenceServiceClient} from './video_intelligence_service_client'; diff --git a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.ts new file mode 100644 index 00000000000..9f529c1574a --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.ts @@ -0,0 +1,556 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/video_intelligence_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './video_intelligence_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements the Video Intelligence API. + * @class + * @memberof v1 + */ +export class VideoIntelligenceServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; + videoIntelligenceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VideoIntelligenceServiceClient. + * + * @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 VideoIntelligenceServiceClient({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 VideoIntelligenceServiceClient; + 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); + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v1/operations/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + delete: + '/v1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/v1/operations/{name=projects/*/locations/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const annotateVideoResponse = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1.AnnotateVideoResponse' + ) as gax.protobuf.Type; + const annotateVideoMetadata = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1.AnnotateVideoProgress' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + annotateVideo: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + annotateVideoResponse.decode.bind(annotateVideoResponse), + annotateVideoMetadata.decode.bind(annotateVideoMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.videointelligence.v1.VideoIntelligenceService', + 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.videoIntelligenceServiceStub) { + return this.videoIntelligenceServiceStub; + } + + // Put together the "service stub" for + // google.cloud.videointelligence.v1.VideoIntelligenceService. + this.videoIntelligenceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.videointelligence.v1.VideoIntelligenceService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.videointelligence.v1 + .VideoIntelligenceService, + 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 videoIntelligenceServiceStubMethods = ['annotateVideo']; + for (const methodName of videoIntelligenceServiceStubMethods) { + const callPromise = this.videoIntelligenceServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.videoIntelligenceServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'videointelligence.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 'videointelligence.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 -- + // ------------------- + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.inputUri + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * @param {Buffer} request.inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * @param {number[]} request.features + * Required. Requested video annotation features. + * @param {google.cloud.videointelligence.v1.VideoContext} request.videoContext + * Additional video context and/or feature-specific parameters. + * @param {string} [request.outputUri] + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @param {string} [request.locationId] + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + annotateVideo( + request?: protos.google.cloud.videointelligence.v1.IAnnotateVideoRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + annotateVideo( + request: protos.google.cloud.videointelligence.v1.IAnnotateVideoRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request: protos.google.cloud.videointelligence.v1.IAnnotateVideoRequest, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request?: protos.google.cloud.videointelligence.v1.IAnnotateVideoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.annotateVideo(request, options, callback); + } + /** + * Check the status of the long running operation returned by `annotateVideo()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + async checkAnnotateVideoProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.videointelligence.v1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.AnnotateVideoProgress + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.annotateVideo, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.videointelligence.v1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.AnnotateVideoProgress + >; + } + + /** + * 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.videoIntelligenceServiceStub && !this._terminated) { + return this.videoIntelligenceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client_config.json b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client_config.json new file mode 100644 index 00000000000..49091879c8e --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.videointelligence.v1.VideoIntelligenceService": { + "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 + }, + "44183339c3ec233f7d8e740ee644b7ceb1a77fc3": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnnotateVideo": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..e28d401f1a2 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1beta2/gapic_metadata.json b/packages/google-cloud-videointelligence/src/v1beta2/gapic_metadata.json new file mode 100644 index 00000000000..a1dcd92a1ab --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta2/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.videointelligence.v1beta2", + "libraryPackage": "@google-cloud/video-intelligence", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1beta2/index.ts b/packages/google-cloud-videointelligence/src/v1beta2/index.ts new file mode 100644 index 00000000000..6fcd19333aa --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta2/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 {VideoIntelligenceServiceClient} from './video_intelligence_service_client'; diff --git a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.ts new file mode 100644 index 00000000000..33a3dcd8c64 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.ts @@ -0,0 +1,557 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta2/video_intelligence_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './video_intelligence_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Video Intelligence API. + * @class + * @memberof v1beta2 + */ +export class VideoIntelligenceServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; + videoIntelligenceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VideoIntelligenceServiceClient. + * + * @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 VideoIntelligenceServiceClient({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 VideoIntelligenceServiceClient; + 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); + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta2/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta2/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1beta2/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta2/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + delete: + '/v1beta2/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta2/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v1beta2/operations/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const annotateVideoResponse = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse' + ) as gax.protobuf.Type; + const annotateVideoMetadata = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + annotateVideo: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + annotateVideoResponse.decode.bind(annotateVideoResponse), + annotateVideoMetadata.decode.bind(annotateVideoMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.videointelligence.v1beta2.VideoIntelligenceService', + 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.videoIntelligenceServiceStub) { + return this.videoIntelligenceServiceStub; + } + + // Put together the "service stub" for + // google.cloud.videointelligence.v1beta2.VideoIntelligenceService. + this.videoIntelligenceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.videointelligence.v1beta2.VideoIntelligenceService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.videointelligence.v1beta2 + .VideoIntelligenceService, + 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 videoIntelligenceServiceStubMethods = ['annotateVideo']; + for (const methodName of videoIntelligenceServiceStubMethods) { + const callPromise = this.videoIntelligenceServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.videoIntelligenceServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'videointelligence.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 'videointelligence.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 -- + // ------------------- + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.inputUri + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * @param {Buffer} request.inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * @param {number[]} request.features + * Required. Requested video annotation features. + * @param {google.cloud.videointelligence.v1beta2.VideoContext} request.videoContext + * Additional video context and/or feature-specific parameters. + * @param {string} [request.outputUri] + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @param {string} [request.locationId] + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_async + */ + annotateVideo( + request?: protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + annotateVideo( + request: protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request: protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request?: protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.annotateVideo(request, options, callback); + } + /** + * Check the status of the long running operation returned by `annotateVideo()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta2/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_async + */ + async checkAnnotateVideoProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.annotateVideo, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + >; + } + + /** + * 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.videoIntelligenceServiceStub && !this._terminated) { + return this.videoIntelligenceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client_config.json b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client_config.json new file mode 100644 index 00000000000..f1fd51a88e2 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.videointelligence.v1beta2.VideoIntelligenceService": { + "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 + }, + "44183339c3ec233f7d8e740ee644b7ceb1a77fc3": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnnotateVideo": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..02f0a919dcd --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1beta2/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/gapic_metadata.json b/packages/google-cloud-videointelligence/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..624b137955a --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.videointelligence.v1p1beta1", + "libraryPackage": "@google-cloud/video-intelligence", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/index.ts b/packages/google-cloud-videointelligence/src/v1p1beta1/index.ts new file mode 100644 index 00000000000..6fcd19333aa --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/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 {VideoIntelligenceServiceClient} from './video_intelligence_service_client'; diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts new file mode 100644 index 00000000000..ed8e8a4e65f --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.ts @@ -0,0 +1,557 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/video_intelligence_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './video_intelligence_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Video Intelligence API. + * @class + * @memberof v1p1beta1 + */ +export class VideoIntelligenceServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; + videoIntelligenceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VideoIntelligenceServiceClient. + * + * @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 VideoIntelligenceServiceClient({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 VideoIntelligenceServiceClient; + 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); + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1p1beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1p1beta1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1p1beta1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1p1beta1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + delete: + '/v1p1beta1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1p1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v1p1beta1/operations/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const annotateVideoResponse = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse' + ) as gax.protobuf.Type; + const annotateVideoMetadata = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + annotateVideo: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + annotateVideoResponse.decode.bind(annotateVideoResponse), + annotateVideoMetadata.decode.bind(annotateVideoMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService', + 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.videoIntelligenceServiceStub) { + return this.videoIntelligenceServiceStub; + } + + // Put together the "service stub" for + // google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService. + this.videoIntelligenceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.videointelligence.v1p1beta1 + .VideoIntelligenceService, + 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 videoIntelligenceServiceStubMethods = ['annotateVideo']; + for (const methodName of videoIntelligenceServiceStubMethods) { + const callPromise = this.videoIntelligenceServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.videoIntelligenceServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'videointelligence.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 'videointelligence.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 -- + // ------------------- + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.inputUri + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * @param {Buffer} request.inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * @param {number[]} request.features + * Required. Requested video annotation features. + * @param {google.cloud.videointelligence.v1p1beta1.VideoContext} request.videoContext + * Additional video context and/or feature-specific parameters. + * @param {string} [request.outputUri] + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @param {string} [request.locationId] + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + annotateVideo( + request?: protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + annotateVideo( + request: protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request: protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request?: protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.annotateVideo(request, options, callback); + } + /** + * Check the status of the long running operation returned by `annotateVideo()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p1beta1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + async checkAnnotateVideoProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.annotateVideo, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress + >; + } + + /** + * 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.videoIntelligenceServiceStub && !this._terminated) { + return this.videoIntelligenceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client_config.json b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client_config.json new file mode 100644 index 00000000000..5d0c24dbde6 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService": { + "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 + }, + "44183339c3ec233f7d8e740ee644b7ceb1a77fc3": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnnotateVideo": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..4213216a5f9 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p1beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/gapic_metadata.json b/packages/google-cloud-videointelligence/src/v1p2beta1/gapic_metadata.json new file mode 100644 index 00000000000..701b895caf6 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.videointelligence.v1p2beta1", + "libraryPackage": "@google-cloud/video-intelligence", + "services": { + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/index.ts b/packages/google-cloud-videointelligence/src/v1p2beta1/index.ts new file mode 100644 index 00000000000..6fcd19333aa --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/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 {VideoIntelligenceServiceClient} from './video_intelligence_service_client'; diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts new file mode 100644 index 00000000000..d14f83c2bc4 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.ts @@ -0,0 +1,555 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1p2beta1/video_intelligence_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './video_intelligence_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Video Intelligence API. + * @class + * @memberof v1p2beta1 + */ +export class VideoIntelligenceServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; + videoIntelligenceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VideoIntelligenceServiceClient. + * + * @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 VideoIntelligenceServiceClient({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 VideoIntelligenceServiceClient; + 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); + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1p2beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1p2beta1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1p2beta1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1p2beta1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + delete: + '/v1p2beta1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1p2beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v1p2beta1/operations/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const annotateVideoResponse = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse' + ) as gax.protobuf.Type; + const annotateVideoMetadata = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + annotateVideo: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + annotateVideoResponse.decode.bind(annotateVideoResponse), + annotateVideoMetadata.decode.bind(annotateVideoMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService', + 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.videoIntelligenceServiceStub) { + return this.videoIntelligenceServiceStub; + } + + // Put together the "service stub" for + // google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService. + this.videoIntelligenceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.videointelligence.v1p2beta1 + .VideoIntelligenceService, + 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 videoIntelligenceServiceStubMethods = ['annotateVideo']; + for (const methodName of videoIntelligenceServiceStubMethods) { + const callPromise = this.videoIntelligenceServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.videoIntelligenceServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'videointelligence.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 'videointelligence.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 -- + // ------------------- + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.inputUri + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For more information, see + * [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). + * A video URI may include wildcards in `object-id`, and thus identify + * multiple videos. Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * @param {Buffer} request.inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * @param {number[]} request.features + * Required. Requested video annotation features. + * @param {google.cloud.videointelligence.v1p2beta1.VideoContext} request.videoContext + * Additional video context and/or feature-specific parameters. + * @param {string} [request.outputUri] + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For more information, see + * [Request URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @param {string} [request.locationId] + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + annotateVideo( + request?: protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + annotateVideo( + request: protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request: protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request?: protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.annotateVideo(request, options, callback); + } + /** + * Check the status of the long running operation returned by `annotateVideo()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p2beta1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + async checkAnnotateVideoProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.annotateVideo, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress + >; + } + + /** + * 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.videoIntelligenceServiceStub && !this._terminated) { + return this.videoIntelligenceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client_config.json b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client_config.json new file mode 100644 index 00000000000..20e275281ce --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService": { + "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 + }, + "44183339c3ec233f7d8e740ee644b7ceb1a77fc3": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnnotateVideo": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..64abb974b04 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/gapic_metadata.json b/packages/google-cloud-videointelligence/src/v1p3beta1/gapic_metadata.json new file mode 100644 index 00000000000..eac12ff507b --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.videointelligence.v1p3beta1", + "libraryPackage": "@google-cloud/video-intelligence", + "services": { + "StreamingVideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "StreamingVideoIntelligenceServiceClient", + "rpcs": { + "StreamingAnnotateVideo": { + "methods": [ + "streamingAnnotateVideo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "StreamingVideoIntelligenceServiceClient", + "rpcs": {} + } + } + }, + "VideoIntelligenceService": { + "clients": { + "grpc": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VideoIntelligenceServiceClient", + "rpcs": { + "AnnotateVideo": { + "methods": [ + "annotateVideo" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/index.ts b/packages/google-cloud-videointelligence/src/v1p3beta1/index.ts new file mode 100644 index 00000000000..a8ec5240351 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/index.ts @@ -0,0 +1,20 @@ +// 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 {StreamingVideoIntelligenceServiceClient} from './streaming_video_intelligence_service_client'; +export {VideoIntelligenceServiceClient} from './video_intelligence_service_client'; diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts new file mode 100644 index 00000000000..fa26e48e02a --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.ts @@ -0,0 +1,366 @@ +// 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, +} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1p3beta1/streaming_video_intelligence_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './streaming_video_intelligence_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements streaming Video Intelligence API. + * @class + * @memberof v1p3beta1 + */ +export class StreamingVideoIntelligenceServiceClient { + 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}; + streamingVideoIntelligenceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of StreamingVideoIntelligenceServiceClient. + * + * @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 StreamingVideoIntelligenceServiceClient({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 StreamingVideoIntelligenceServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingAnnotateVideo: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + opts.fallback === 'rest' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService', + 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.streamingVideoIntelligenceServiceStub) { + return this.streamingVideoIntelligenceServiceStub; + } + + // Put together the "service stub" for + // google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService. + this.streamingVideoIntelligenceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.videointelligence.v1p3beta1 + .StreamingVideoIntelligenceService, + 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 streamingVideoIntelligenceServiceStubMethods = [ + 'streamingAnnotateVideo', + ]; + for (const methodName of streamingVideoIntelligenceServiceStubMethods) { + const callPromise = this.streamingVideoIntelligenceServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) + ); + }); + return stream; + } + 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.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.streamingVideoIntelligenceServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'videointelligence.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 'videointelligence.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 -- + // ------------------- + + /** + * Performs video annotation with bidirectional streaming: emitting results + * while sending video/audio bytes. + * This method is only available via the gRPC API (not REST). + * + * @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 is both readable and writable. It accepts objects + * representing [StreamingAnnotateVideoRequest]{@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest} for write() method, and + * will emit objects representing [StreamingAnnotateVideoResponse]{@link google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse} on 'data' event asynchronously. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) + * for more details and examples. + * @example include:samples/generated/v1p3beta1/streaming_video_intelligence_service.streaming_annotate_video.js + * region_tag:videointelligence_v1p3beta1_generated_StreamingVideoIntelligenceService_StreamingAnnotateVideo_async + */ + streamingAnnotateVideo(options?: CallOptions): gax.CancellableStream { + this.initialize(); + return this.innerApiCalls.streamingAnnotateVideo(null, options); + } + + /** + * 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.streamingVideoIntelligenceServiceStub && !this._terminated) { + return this.streamingVideoIntelligenceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client_config.json b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client_config.json new file mode 100644 index 00000000000..b569dbe81f9 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService": { + "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": { + "StreamingAnnotateVideo": { + "timeout_millis": 10800000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..85fbf375df1 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts new file mode 100644 index 00000000000..bf1dbc95c9a --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.ts @@ -0,0 +1,558 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1p3beta1/video_intelligence_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './video_intelligence_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service that implements the Video Intelligence API. + * @class + * @memberof v1p3beta1 + */ +export class VideoIntelligenceServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; + videoIntelligenceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VideoIntelligenceServiceClient. + * + * @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 VideoIntelligenceServiceClient({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 VideoIntelligenceServiceClient; + 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); + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1p3beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1p3beta1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + get: '/v1p3beta1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1p3beta1/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + { + delete: + '/v1p3beta1/operations/{name=projects/*/locations/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1p3beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v1p3beta1/operations/{name=projects/*/locations/*/operations/*}:cancel', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const annotateVideoResponse = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse' + ) as gax.protobuf.Type; + const annotateVideoMetadata = protoFilesRoot.lookup( + '.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + annotateVideo: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + annotateVideoResponse.decode.bind(annotateVideoResponse), + annotateVideoMetadata.decode.bind(annotateVideoMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService', + 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.videoIntelligenceServiceStub) { + return this.videoIntelligenceServiceStub; + } + + // Put together the "service stub" for + // google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService. + this.videoIntelligenceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.videointelligence.v1p3beta1 + .VideoIntelligenceService, + 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 videoIntelligenceServiceStubMethods = ['annotateVideo']; + for (const methodName of videoIntelligenceServiceStubMethods) { + const callPromise = this.videoIntelligenceServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.videoIntelligenceServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'videointelligence.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 'videointelligence.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 -- + // ------------------- + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.inputUri + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * @param {Buffer} request.inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * @param {number[]} request.features + * Required. Requested video annotation features. + * @param {google.cloud.videointelligence.v1p3beta1.VideoContext} request.videoContext + * Additional video context and/or feature-specific parameters. + * @param {string} [request.outputUri] + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * {@link google.rpc.Code.INVALID_ARGUMENT|google.rpc.Code.INVALID_ARGUMENT}). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @param {string} [request.locationId] + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + annotateVideo( + request?: protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + annotateVideo( + request: protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request: protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, + callback: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + annotateVideo( + request?: protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.annotateVideo(request, options, callback); + } + /** + * Check the status of the long running operation returned by `annotateVideo()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1p3beta1/video_intelligence_service.annotate_video.js + * region_tag:videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_async + */ + async checkAnnotateVideoProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.annotateVideo, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress + >; + } + + /** + * 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.videoIntelligenceServiceStub && !this._terminated) { + return this.videoIntelligenceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client_config.json b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client_config.json new file mode 100644 index 00000000000..c9796e48a4a --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService": { + "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 + }, + "44183339c3ec233f7d8e740ee644b7ceb1a77fc3": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.5, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "AnnotateVideo": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "44183339c3ec233f7d8e740ee644b7ceb1a77fc3" + } + } + } + } +} diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..85fbf375df1 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/system-test/.eslintrc.yml b/packages/google-cloud-videointelligence/system-test/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-videointelligence/system-test/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-videointelligence/system-test/fixtures/sample/src/index.js b/packages/google-cloud-videointelligence/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f4d83dcf5e1 --- /dev/null +++ b/packages/google-cloud-videointelligence/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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 videointelligence = require('@google-cloud/video-intelligence'); + +function main() { + const videoIntelligenceServiceClient = + new videointelligence.VideoIntelligenceServiceClient(); +} + +main(); diff --git a/packages/google-cloud-videointelligence/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-videointelligence/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bf954ad231a --- /dev/null +++ b/packages/google-cloud-videointelligence/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {VideoIntelligenceServiceClient} from '@google-cloud/video-intelligence'; + +// check that the client class type name can be used +function doStuffWithVideoIntelligenceServiceClient( + client: VideoIntelligenceServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const videoIntelligenceServiceClient = new VideoIntelligenceServiceClient(); + doStuffWithVideoIntelligenceServiceClient(videoIntelligenceServiceClient); +} + +main(); diff --git a/packages/google-cloud-videointelligence/system-test/install.ts b/packages/google-cloud-videointelligence/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-videointelligence/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-videointelligence/test/gapic_streaming_video_intelligence_service_v1p3beta1.ts b/packages/google-cloud-videointelligence/test/gapic_streaming_video_intelligence_service_v1p3beta1.ts new file mode 100644 index 00000000000..a318a05048c --- /dev/null +++ b/packages/google-cloud-videointelligence/test/gapic_streaming_video_intelligence_service_v1p3beta1.ts @@ -0,0 +1,292 @@ +// 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 streamingvideointelligenceserviceModule 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 stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +describe('v1p3beta1.StreamingVideoIntelligenceServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + streamingvideointelligenceserviceModule.v1p3beta1 + .StreamingVideoIntelligenceServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + streamingvideointelligenceserviceModule.v1p3beta1 + .StreamingVideoIntelligenceServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + streamingvideointelligenceserviceModule.v1p3beta1 + .StreamingVideoIntelligenceServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.streamingVideoIntelligenceServiceStub, + undefined + ); + await client.initialize(); + assert(client.streamingVideoIntelligenceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.streamingVideoIntelligenceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.streamingVideoIntelligenceServiceStub, + undefined + ); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + 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 streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + 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('streamingAnnotateVideo', () => { + it('invokes streamingAnnotateVideo without error', async () => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse() + ); + client.innerApiCalls.streamingAnnotateVideo = + stubBidiStreamingCall(expectedResponse); + const stream = client.streamingAnnotateVideo(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingAnnotateVideo as SinonStub) + .getCall(0) + .calledWith(null) + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request + ); + }); + + it('invokes streamingAnnotateVideo with error', async () => { + const client = + new streamingvideointelligenceserviceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingAnnotateVideo = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.streamingAnnotateVideo(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.streamingAnnotateVideo as SinonStub) + .getCall(0) + .calledWith(null) + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request + ); + }); + }); +}); diff --git a/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1.ts b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1.ts new file mode 100644 index 00000000000..24ff4ee2cdf --- /dev/null +++ b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1.ts @@ -0,0 +1,343 @@ +// 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 videointelligenceserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1.VideoIntelligenceServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + videointelligenceserviceModule.v1.VideoIntelligenceServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + videointelligenceserviceModule.v1.VideoIntelligenceServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + videointelligenceserviceModule.v1.VideoIntelligenceServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + await client.initialize(); + assert(client.videoIntelligenceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.videoIntelligenceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + 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 videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + 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('annotateVideo', () => { + it('invokes annotateVideo without error', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCall(expectedResponse); + const [operation] = await client.annotateVideo(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo without error using callback', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateVideo( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.videointelligence.v1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1.IAnnotateVideoProgress + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo with call error', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateVideo(request), expectedError); + }); + + it('invokes annotateVideo with LRO error', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.annotateVideo(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkAnnotateVideoProgress without error', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAnnotateVideoProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnnotateVideoProgress with error', async () => { + const client = + new videointelligenceserviceModule.v1.VideoIntelligenceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAnnotateVideoProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); +}); diff --git a/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1beta2.ts b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1beta2.ts new file mode 100644 index 00000000000..c01bbfa1f72 --- /dev/null +++ b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1beta2.ts @@ -0,0 +1,368 @@ +// 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 videointelligenceserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1beta2.VideoIntelligenceServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + await client.initialize(); + assert(client.videoIntelligenceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.videoIntelligenceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + 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 videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + 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('annotateVideo', () => { + it('invokes annotateVideo without error', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCall(expectedResponse); + const [operation] = await client.annotateVideo(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo without error using callback', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateVideo( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1beta2.IAnnotateVideoProgress + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo with call error', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateVideo(request), expectedError); + }); + + it('invokes annotateVideo with LRO error', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.annotateVideo(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkAnnotateVideoProgress without error', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAnnotateVideoProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnnotateVideoProgress with error', async () => { + const client = + new videointelligenceserviceModule.v1beta2.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAnnotateVideoProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); +}); diff --git a/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p1beta1.ts b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p1beta1.ts new file mode 100644 index 00000000000..2908e4f5320 --- /dev/null +++ b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p1beta1.ts @@ -0,0 +1,368 @@ +// 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 videointelligenceserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1p1beta1.VideoIntelligenceServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + await client.initialize(); + assert(client.videoIntelligenceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.videoIntelligenceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + 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 videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + 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('annotateVideo', () => { + it('invokes annotateVideo without error', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCall(expectedResponse); + const [operation] = await client.annotateVideo(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo without error using callback', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateVideo( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p1beta1.IAnnotateVideoProgress + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo with call error', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateVideo(request), expectedError); + }); + + it('invokes annotateVideo with LRO error', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.annotateVideo(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkAnnotateVideoProgress without error', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAnnotateVideoProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnnotateVideoProgress with error', async () => { + const client = + new videointelligenceserviceModule.v1p1beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAnnotateVideoProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); +}); diff --git a/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p2beta1.ts b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p2beta1.ts new file mode 100644 index 00000000000..451fa85be32 --- /dev/null +++ b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p2beta1.ts @@ -0,0 +1,368 @@ +// 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 videointelligenceserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1p2beta1.VideoIntelligenceServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + await client.initialize(); + assert(client.videoIntelligenceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.videoIntelligenceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + 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 videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + 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('annotateVideo', () => { + it('invokes annotateVideo without error', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCall(expectedResponse); + const [operation] = await client.annotateVideo(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo without error using callback', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateVideo( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p2beta1.IAnnotateVideoProgress + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo with call error', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateVideo(request), expectedError); + }); + + it('invokes annotateVideo with LRO error', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.annotateVideo(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkAnnotateVideoProgress without error', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAnnotateVideoProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnnotateVideoProgress with error', async () => { + const client = + new videointelligenceserviceModule.v1p2beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAnnotateVideoProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); +}); diff --git a/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p3beta1.ts b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p3beta1.ts new file mode 100644 index 00000000000..f3b369914ad --- /dev/null +++ b/packages/google-cloud-videointelligence/test/gapic_video_intelligence_service_v1p3beta1.ts @@ -0,0 +1,368 @@ +// 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 videointelligenceserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +describe('v1p3beta1.VideoIntelligenceServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + await client.initialize(); + assert(client.videoIntelligenceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.videoIntelligenceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.videoIntelligenceServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + 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 videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + 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('annotateVideo', () => { + it('invokes annotateVideo without error', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCall(expectedResponse); + const [operation] = await client.annotateVideo(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo without error using callback', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.annotateVideo = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.annotateVideo( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoResponse, + protos.google.cloud.videointelligence.v1p3beta1.IAnnotateVideoProgress + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes annotateVideo with call error', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.annotateVideo(request), expectedError); + }); + + it('invokes annotateVideo with LRO error', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.annotateVideo = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.annotateVideo(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkAnnotateVideoProgress without error', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAnnotateVideoProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnnotateVideoProgress with error', async () => { + const client = + new videointelligenceserviceModule.v1p3beta1.VideoIntelligenceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAnnotateVideoProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); +}); diff --git a/packages/google-cloud-videointelligence/tsconfig.json b/packages/google-cloud-videointelligence/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-videointelligence/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-videointelligence/webpack.config.js b/packages/google-cloud-videointelligence/webpack.config.js new file mode 100644 index 00000000000..c459721afee --- /dev/null +++ b/packages/google-cloud-videointelligence/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: 'videointelligence', + filename: './videointelligence.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index 7a0625b3ae6..6d97ebbeb08 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,4 +1,5 @@ { + "initial-version": "0.1.0", "packages": { "packages/google-api-apikeys": {}, "packages/google-cloud-batch": {}, @@ -12,10 +13,12 @@ "packages/google-cloud-bigquery-datapolicies": {}, "packages/google-cloud-bigquery-datatransfer": {}, "packages/google-cloud-bigquery-reservation": {}, - "packages/google-cloud-gkeconnect-gateway": {}, - "packages/google-cloud-deploy": {}, - "packages/google-cloud-dataplex": {}, "packages/google-cloud-certificatemanager": {}, + "packages/google-cloud-contentwarehouse": {}, + "packages/google-cloud-dataplex": {}, + "packages/google-cloud-deploy": {}, + "packages/google-cloud-discoveryengine": {}, + "packages/google-cloud-gkeconnect-gateway": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, "packages/google-cloud-memcache": {}, @@ -27,20 +30,18 @@ "packages/google-cloud-resourcemanager": {}, "packages/google-cloud-security-publicca": {}, "packages/google-cloud-shell": {}, + "packages/google-cloud-videointelligence": {}, "packages/google-devtools-artifactregistry": {}, "packages/google-iam": {}, + "packages/google-maps-addressvalidation": {}, "packages/google-maps-routing": {}, "packages/google-monitoring-dashboard": {}, - "packages/typeless-sample-bot": {}, - "packages/google-cloud-discoveryengine": {}, - "packages/google-cloud-contentwarehouse": {}, - "packages/google-maps-addressvalidation": {} + "packages/typeless-sample-bot": {} }, "plugins": [ { "type": "sentence-case" } ], - "release-type": "node", - "initial-version": "0.1.0" + "release-type": "node" } \ No newline at end of file